我在做一个swing的东西,不知道你想要什么?
是不是如何布局?以下只是一个框架,你看一下吧
---------------------
package swp5;import javax.swing.*;
import java.awt.*;
import com.borland.jbcl.layout.*;
import javax.swing.border.*;/**
* <p>Title: 涉外企业等级管理系统</p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2003潍坊市奎文国家税务局</p>
* <p>Company: </p>
* @author not attributable
* @version 1.5
*/public class fenge extends JFrame {
JPanel jPanel1 = new JPanel();
JSplitPane jSplitPane1 = new JSplitPane();
BorderLayout borderLayout1 = new BorderLayout();
JPanel jPanel2 = new JPanel();
JPanel jPanel3 = new JPanel();
Border border1;
BorderLayout borderLayout2 = new BorderLayout();
JPanel jPanel4 = new JPanel();
JPanel jPanel5 = new JPanel();
Border border2;
JPanel jPanel6 = new JPanel();
JLabel jLabel1 = new JLabel();
XYLayout xYLayout1 = new XYLayout();
Border border3;
XYLayout xYLayout2 = new XYLayout();
JTabbedPane jTabbedPane1 = new JTabbedPane();
BorderLayout borderLayout3 = new BorderLayout();
JPanel tj1 = new JPanel();
JPanel tj2 = new JPanel();
JButton jButton3 = new JButton();
JScrollPane jScrollPane1 = new JScrollPane();
BorderLayout borderLayout4 = new BorderLayout();
JList jList1 = new JList();
JPanel jPanel7 = new JPanel();
BorderLayout borderLayout5 = new BorderLayout();
BorderLayout borderLayout6 = new BorderLayout();
JPanel jPanel8 = new JPanel();
JPanel jPanel9 = new JPanel();
JPanel jPanel10 = new JPanel();
JPanel jPanel11 = new JPanel();
JPanel jPanel12 = new JPanel();
TitledBorder titledBorder1; public fenge() {
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
fenge fenge = new fenge();
fenge.pack();
fenge.setVisible(true);
}
private void jbInit() throws Exception {
border1 = new TitledBorder(new EtchedBorder(EtchedBorder.RAISED,Color.white,new Color(148, 145, 140)),"财务指标项");
border2 = new TitledBorder(new EtchedBorder(EtchedBorder.RAISED,Color.white,new Color(148, 145, 140)),"查询条件");
border3 = new EtchedBorder(EtchedBorder.RAISED,Color.white,new Color(148, 145, 140));
titledBorder1 = new TitledBorder("");
jPanel1.setLayout(borderLayout1);
jPanel2.setBorder(border1);
jPanel2.setLayout(borderLayout4);
jPanel3.setLayout(borderLayout2);
jPanel4.setBorder(border2);
jPanel4.setLayout(borderLayout3);
jLabel1.setText("jLabel1");
jPanel6.setBackground(Color.white);
jPanel6.setBorder(titledBorder1);
jPanel6.setLayout(xYLayout1);
jPanel5.setBorder(border3);
jPanel5.setLayout(xYLayout2);
jButton3.setText("jButton3");
tj1.setLayout(borderLayout6);
tj2.setLayout(borderLayout5);
jPanel7.setBorder(BorderFactory.createEtchedBorder());
jPanel11.setBorder(BorderFactory.createEtchedBorder());
jPanel10.setBorder(BorderFactory.createEtchedBorder());
jPanel12.setBorder(BorderFactory.createEtchedBorder());
jPanel8.setBorder(BorderFactory.createEtchedBorder());
jPanel9.setBorder(BorderFactory.createEtchedBorder());
jList1.setBackground(Color.lightGray);
this.getContentPane().add(jPanel1, BorderLayout.CENTER);
jPanel1.add(jSplitPane1, BorderLayout.CENTER);
jSplitPane1.add(jPanel2, JSplitPane.LEFT);
jPanel2.add(jScrollPane1, BorderLayout.CENTER);
jScrollPane1.getViewport().add(jList1, null);
jSplitPane1.add(jPanel3, JSplitPane.RIGHT);
jPanel3.add(jPanel4, BorderLayout.CENTER);
jPanel4.add(jTabbedPane1, BorderLayout.CENTER);
jTabbedPane1.add(tj1, "单企业");
tj1.add(jPanel8, BorderLayout.CENTER);
tj1.add(jPanel9, BorderLayout.SOUTH);
tj1.add(jPanel12, BorderLayout.NORTH);
jTabbedPane1.add(tj2, "行业查询");
tj2.add(jPanel7, BorderLayout.CENTER);
tj2.add(jPanel10, BorderLayout.SOUTH);
tj2.add(jPanel11, BorderLayout.NORTH);
jPanel3.add(jPanel5, BorderLayout.SOUTH);
jPanel5.add(jButton3, new XYConstraints(136, 0, -1, -1));
jPanel1.add(jPanel6, BorderLayout.NORTH);
jPanel6.add(jLabel1, new XYConstraints(4, 2, 236, 37));
}
}
是不是如何布局?以下只是一个框架,你看一下吧
---------------------
package swp5;import javax.swing.*;
import java.awt.*;
import com.borland.jbcl.layout.*;
import javax.swing.border.*;/**
* <p>Title: 涉外企业等级管理系统</p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2003潍坊市奎文国家税务局</p>
* <p>Company: </p>
* @author not attributable
* @version 1.5
*/public class fenge extends JFrame {
JPanel jPanel1 = new JPanel();
JSplitPane jSplitPane1 = new JSplitPane();
BorderLayout borderLayout1 = new BorderLayout();
JPanel jPanel2 = new JPanel();
JPanel jPanel3 = new JPanel();
Border border1;
BorderLayout borderLayout2 = new BorderLayout();
JPanel jPanel4 = new JPanel();
JPanel jPanel5 = new JPanel();
Border border2;
JPanel jPanel6 = new JPanel();
JLabel jLabel1 = new JLabel();
XYLayout xYLayout1 = new XYLayout();
Border border3;
XYLayout xYLayout2 = new XYLayout();
JTabbedPane jTabbedPane1 = new JTabbedPane();
BorderLayout borderLayout3 = new BorderLayout();
JPanel tj1 = new JPanel();
JPanel tj2 = new JPanel();
JButton jButton3 = new JButton();
JScrollPane jScrollPane1 = new JScrollPane();
BorderLayout borderLayout4 = new BorderLayout();
JList jList1 = new JList();
JPanel jPanel7 = new JPanel();
BorderLayout borderLayout5 = new BorderLayout();
BorderLayout borderLayout6 = new BorderLayout();
JPanel jPanel8 = new JPanel();
JPanel jPanel9 = new JPanel();
JPanel jPanel10 = new JPanel();
JPanel jPanel11 = new JPanel();
JPanel jPanel12 = new JPanel();
TitledBorder titledBorder1; public fenge() {
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
fenge fenge = new fenge();
fenge.pack();
fenge.setVisible(true);
}
private void jbInit() throws Exception {
border1 = new TitledBorder(new EtchedBorder(EtchedBorder.RAISED,Color.white,new Color(148, 145, 140)),"财务指标项");
border2 = new TitledBorder(new EtchedBorder(EtchedBorder.RAISED,Color.white,new Color(148, 145, 140)),"查询条件");
border3 = new EtchedBorder(EtchedBorder.RAISED,Color.white,new Color(148, 145, 140));
titledBorder1 = new TitledBorder("");
jPanel1.setLayout(borderLayout1);
jPanel2.setBorder(border1);
jPanel2.setLayout(borderLayout4);
jPanel3.setLayout(borderLayout2);
jPanel4.setBorder(border2);
jPanel4.setLayout(borderLayout3);
jLabel1.setText("jLabel1");
jPanel6.setBackground(Color.white);
jPanel6.setBorder(titledBorder1);
jPanel6.setLayout(xYLayout1);
jPanel5.setBorder(border3);
jPanel5.setLayout(xYLayout2);
jButton3.setText("jButton3");
tj1.setLayout(borderLayout6);
tj2.setLayout(borderLayout5);
jPanel7.setBorder(BorderFactory.createEtchedBorder());
jPanel11.setBorder(BorderFactory.createEtchedBorder());
jPanel10.setBorder(BorderFactory.createEtchedBorder());
jPanel12.setBorder(BorderFactory.createEtchedBorder());
jPanel8.setBorder(BorderFactory.createEtchedBorder());
jPanel9.setBorder(BorderFactory.createEtchedBorder());
jList1.setBackground(Color.lightGray);
this.getContentPane().add(jPanel1, BorderLayout.CENTER);
jPanel1.add(jSplitPane1, BorderLayout.CENTER);
jSplitPane1.add(jPanel2, JSplitPane.LEFT);
jPanel2.add(jScrollPane1, BorderLayout.CENTER);
jScrollPane1.getViewport().add(jList1, null);
jSplitPane1.add(jPanel3, JSplitPane.RIGHT);
jPanel3.add(jPanel4, BorderLayout.CENTER);
jPanel4.add(jTabbedPane1, BorderLayout.CENTER);
jTabbedPane1.add(tj1, "单企业");
tj1.add(jPanel8, BorderLayout.CENTER);
tj1.add(jPanel9, BorderLayout.SOUTH);
tj1.add(jPanel12, BorderLayout.NORTH);
jTabbedPane1.add(tj2, "行业查询");
tj2.add(jPanel7, BorderLayout.CENTER);
tj2.add(jPanel10, BorderLayout.SOUTH);
tj2.add(jPanel11, BorderLayout.NORTH);
jPanel3.add(jPanel5, BorderLayout.SOUTH);
jPanel5.add(jButton3, new XYConstraints(136, 0, -1, -1));
jPanel1.add(jPanel6, BorderLayout.NORTH);
jPanel6.add(jLabel1, new XYConstraints(4, 2, 236, 37));
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货