摘要:
1 public class JProgressBarTest extends JFrame{ 2 3 public JProgressBarTest() { 4 super(); 5 setTitle("表格"); 6 setBounds(100,100,350,150); 7 setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 8 final JButton button = new JButton(" "); 9 f... 阅读全文
摘要:
1 public class MenuBarKnow extends JFrame 2 { 3 JMenuBar jMenuBar; 4 5 JMenu jMenuFile,jMenuEditor,jMenuAbout; 6 JMenu jMenuOpen; 7 8 JMenuItem jMenuItemSave,jMenuItemEditor,jMenuItemExit; 9 JMenuItem jMenuItemWord,jMenuItemTxt;10 11 public MenuBarKnow()12 ... 阅读全文
摘要:
1 public class JTabbedPaneKnow extends JFrame 2 { 3 JTabbedPane jTabbedPane; 4 JPanel jPanelRed; 5 JPanel jPanelGreen; 6 JPanel jPanelYellow; 7 JPanel jPanelBlue; 8 public JTabbedPaneKnow() 9 {10 init();11 this.setBounds(200, 50, 500, 500);12 this... 阅读全文
摘要:
1 public class JSplitPaneKnow extends JFrame 2 { 3 JSplitPane jSplitPane; 4 JPanel jPanelRed; 5 JPanel jPanelBlue; 6 7 public JSplitPaneKnow() 8 { 9 this.setBounds(300, 100, 400, 400);10 this.setTitle("分屏设计");11 this.setDefaultCloseOperation(JFrame.E... 阅读全文
摘要:
1 /** 2 * 本例结合JList和JScrollPane共同使用 3 * @author Wfei 4 * 5 */ 6 public class JListKnow extends JFrame 7 { 8 JList jListKnow01; 9 JList jListKnow02;10 JScrollPane jScrollPane02;11 12 JSplitPane jSplitPane;13 JPanel jPanelTop;14 JPanel jPanelBottom;15 public JListK... 阅读全文
摘要:
1 /** 2 * 对话框 - 学习笔记 3 * @author Wfei 4 * 5 */ 6 public class JoptionPaneKnow extends JFrame 7 { 8 public JoptionPaneKnow() 9 {10 init();11 12 this.setLayout(null);13 this.setSize(400, 400);14 //这里设置为null的意思是:该this是相对于那个父窗口居中15 this.setLoc... 阅读全文
摘要:
1 /** 2 * JDilog学习笔记 3 * @author Wfei 4 * 5 */ 6 public class JDialogKnow extends JFrame 7 { 8 JDialog jDialog; 9 JButton jButton;10 public JDialogKnow()11 {12 init();13 14 this.setTitle("主窗体");15 this.setLayout(null);16 this.setSize(500, ... 阅读全文
摘要:
1 public class WindowListenerKnow extends JFrame 2 { 3 public WindowListenerKnow() 4 { 5 this.setBounds(300, 100, 400, 400); 6 this.setTitle("我是测试【x】按钮关闭方法的"); 7 this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 8 } 9 public void init()10 {11 1... 阅读全文
摘要:
1 public class BackgroundImage extends JFrame 2 { 3 public BackgroundImage() 4 { 5 this.setTitle("窗体背景图片设置方法"); 6 this.setSize(700, 471); 7 8 JPanel jPanel = new JPanel() 9 {10 11 @Override12 protected void paintComponent(Grap... 阅读全文