foxspecial

导航

随笔分类 -  swing

java中利用JFrame创建窗体 【转】
摘要:1. 一个简单的swingJava代码publicclassTest(){publicstaticvoidmain(String[]args){JFrameframe=newJFrame();JPanelpanel=newJPanel();JTextAreatextArea=newJTextArea();panel.setLayout(newGridLayout());textArea.setText("test");//当TextArea里的内容过长时生成滚动条panel.add(newJScrollPane(textArea));frame.add(panel);fra 阅读全文

posted @ 2013-07-23 21:18 foxspecial 阅读(1545) 评论(0) 推荐(0)

这个setDefaultCloseOperation写不写的区别是什么?
摘要:2009-03-23 13:40提问者采纳设置用户在此窗体上发起 "close" 时默认执行的操作。必须指定以下选项之一: DO_NOTHING_ON_CLOSE(在 WindowConstants 中定义):不执行任何操作;要求程序在已注册的 WindowListener 对象的 windowClosing 方法中处理该操作。 HIDE_ON_CLOSE(在 WindowConstants 中定义):调用任意已注册的 WindowListener 对象后自动隐藏该窗体。 DISPOSE_ON_CLOSE(在 WindowConstants 中定义):调用任意已注册 Win 阅读全文

posted @ 2013-07-23 16:27 foxspecial 阅读(304) 评论(0) 推荐(0)

swing Event-Listener-Adapter 对照表
摘要:SourceEventEvent ListenerAbstractButton(JButton,JToggleButton,JCheckBox,JRadioButtonActionEventChangEventItemEventActionListenerChangeListenerItemListenerJTextFieldJPasswordFieldActionEventCaretEventDocumentEventUndoableEventActionListenerCaretListenerDocumentListenerUndoableListenerJTextAreaCaretEv 阅读全文

posted @ 2013-07-23 16:09 foxspecial 阅读(427) 评论(0) 推荐(0)