摘要: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
阅读全文
摘要:2009-03-23 13:40提问者采纳设置用户在此窗体上发起 "close" 时默认执行的操作。必须指定以下选项之一: DO_NOTHING_ON_CLOSE(在 WindowConstants 中定义):不执行任何操作;要求程序在已注册的 WindowListener 对象的 windowClosing 方法中处理该操作。 HIDE_ON_CLOSE(在 WindowConstants 中定义):调用任意已注册的 WindowListener 对象后自动隐藏该窗体。 DISPOSE_ON_CLOSE(在 WindowConstants 中定义):调用任意已注册 Win
阅读全文
摘要:SourceEventEvent ListenerAbstractButton(JButton,JToggleButton,JCheckBox,JRadioButtonActionEventChangEventItemEventActionListenerChangeListenerItemListenerJTextFieldJPasswordFieldActionEventCaretEventDocumentEventUndoableEventActionListenerCaretListenerDocumentListenerUndoableListenerJTextAreaCaretEv
阅读全文