本帖最后由 饰演自己 于 2015-9-26 20:50 编辑
配置环境变量:
classpath:.;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\jre\lib\ext\msbase.jar;%JAVA_HOME%\jre\lib\ext\mssqlserver.jar;%JAVA_HOME%\jre\lib\ext\msutil.jar;
path:D:\Program Files\Java\jdk1.7.0_04\bin;
隐藏(各种组件): this.setResizable(false); 可见: this.setResizable(true);
去掉边框(this为JButton、
JTextField等组件): this.setBorder(BorderFactory.createEmptyBorder());
设置边框颜色: jTextArea1.setBorder(new LineBorder(new java.awt.Color(127,157,185), 1, false));
获得JPanel: this.setContentPane(getJContentPane()); private MainPanel getJContentPane() { if (jContentPane == null) { jContentPane = new MainPanel(this);
} return jContentPane; }
点击按钮切换界面(点击jbt_menu1从ShelfPanel切换到StorFrame): public ShelfPanel(JFrame fatherFrame) { super(); this.fatherFrame=fatherFrame; initialize(); } jbt_menu1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { fatherFrame.dispose(); StorFrame storframe=new StorFrame(); storframe.setVisible(true); } }); |
|