预览加载中,请您耐心等待几秒...
1/9
2/9
3/9
4/9
5/9
6/9
7/9
8/9
9/9

在线预览结束,喜欢就下载吧,查找使用更方便

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

浪曦网-国内顶级IT视频网络编程教育平台Www.LangSin.Com JavaGUI中关于布局管理器的使用方法介绍 很多初学者在用Java布局器自动布局画界面时,经常遇见不知道如何定义区域大小或按钮 之间的距离等问题。我写过一篇《实现 浪曦网-国内顶级IT视频网络编程教育平台Www.LangSin.Com 浪曦网-国内顶级IT视频网络编程教育平台Www.LangSin.Com publicclassFrame1 extendsJFrame{ BorderLayoutborderLayout1=newBorderLayout(); JPaneljPanel1=newJPanel(); JPaneljPanel2=newJPanel(); JPaneljPanel3=newJPanel(); JLabeljLabel1=newJLabel(); JTextFieldjTextField1=newJTextField(); JButtonjButton1=newJButton(); FlowLayoutflowLayout1=newFlowLayout(); FlowLayoutflowLayout2=newFlowLayout(); JButtonjButton2=newJButton(); JButtonjButton3=newJButton(); JButtonjButton4=newJButton(); GridLayoutgridLayout1=newGridLayout(); JScrollPanejScrollPane1=newJScrollPane(); JTablejTable1=newJTable(); publicFrame1(){ try{ jbInit(); } catch(Exceptione){ e.printStackTrace(); } } publicstaticvoidmain(String[]args){ Frame1frame1=newFrame1(); frame1.setSize(newDimension(400,350)); frame1.show(); } privatevoidjbInit()throwsException{ this.getContentPane().setLayout(borderLayout1); jPanel1.setBackground(Color.red); jPanel1.setLayout(flowLayout1); jPanel2.setBackground(Color.red); jPanel2.setLayout(flowLayout2); jPanel3.setBackground(Color.pink); jPanel3.setLayout(gridLayout1); jLabel1.setPreferredSize(newDimension(100,16)); jLabel1.setText("请输入查询条件"); 浪曦网-国内顶级IT视频网络编程教育平台Www.LangSin.Com 浪曦网-国内顶级IT视频网络编程教育平台Www.LangSin.Com jTextField1.setPreferredSize(newDimension(140,22)); jTextField1.setText(""); jButton1.setText("查询"); jButton1.addActionListener(newFrame1_jButton1_actionAdapter(this)); flowLayout1.setAlignment(FlowLayout.LEFT); flowLayout1.setHgap(5); flowLayout1.setVgap(10); jButton2.setText("增加"); jButton3.setText("删除"); jButton4.setText("修改"); flowLayout2.setHgap(30); flowLayout2.setVgap(5); this.setDefaultCloseOperation(EXIT_ON_CLOSE); this.getContentPane().add(jPanel1,BorderLayout.NORTH); jPanel1.add(jLabel1,null); jPanel1.add(jTextField1,null); jPanel1.add(jButton1,null); this.getContentPane().add(jPanel2,BorderLayout.SOUTH); jPanel2.add(jB