具有凸凹感的矩形框,该怎么做,在线等候 在jbuilder 中右侧的属性面版的border属性中自己试验看看哪种效果是你喜欢的! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 从SWIN容器组件如JPanel中继承。组件绘制方法 public paint(Graphics g) 调用paintComponent,paintBorder及paintChildren三个保护方法。要有不同的边框,重载paintBorder. public class Frame1 extends JFrame { private JPanel jPanel1 = new JPanel(); private XYLayout xYLayout1 = new XYLayout(); private JPanel jPanel2 = new JPanel(); public Frame1() { try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } private void jbInit() throws Exception { jPanel1.setLayout(xYLayout1); jPanel2.setBackground(Color.lightGray); jPanel2.setBorder(BorderFactory.createRaisedBevelBorder());//---here this.getContentPane().add(jPanel1, BorderLayout.CENTER); jPanel1.add(jPanel2, new XYConstraints(60, 48, 270, 176)); }} extends JComponent,setBorder() 其他组件必须是Component的子类的对象,调用Container的add(Component comp)方法。 在Swing中先放置的组件在后放置的上面请问,怎么解决使组件的放置顺序与显示无关 国际象棋棋盘输出问题 struts 动态Action问题 if/else程序用switch/case 代替 这些包是干什么的? 游戏自动玩 图象更新问题 老问题: Java 回车(\n)和换行(\r)的区别 如何制作一个简单的能打开文本的程序 一个APPLET的简单问题 看大家很多都是用notepad之类写java,那怎么编译呢? 烦死我了!!!!!!!! 请问是否可以移动一个按钮,在线等候 这段代码是干什么用的呢?
组件绘制方法 public paint(Graphics g) 调用paintComponent,
paintBorder及paintChildren三个保护方法。要有不同的边框,重载paintBorder.
private JPanel jPanel1 = new JPanel();
private XYLayout xYLayout1 = new XYLayout();
private JPanel jPanel2 = new JPanel(); public Frame1() {
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
jPanel1.setLayout(xYLayout1);
jPanel2.setBackground(Color.lightGray);
jPanel2.setBorder(BorderFactory.createRaisedBevelBorder());//---here
this.getContentPane().add(jPanel1, BorderLayout.CENTER);
jPanel1.add(jPanel2, new XYConstraints(60, 48, 270, 176));
}
}
setBorder()
请问,怎么解决使组件的放置顺序与显示无关