Calculator
An interface, a function
Parameters are implemented in arrays with variable number of parameters,
Viewing the source code can also be viewed from the JRE package
Box Grid layout Manager
Box:creatverticalbox
JScrollPane
JSplitPane
JTree
JTable
Java Event-driven model
Button.addactionlistener (/* parameter is a actionlistener*/)//interface-oriented programming
Class Cbuttonexit implements actionlistener{
public void actionperformed (ActionEvent argo) {
System.exit (0);
}
}//ctrl+1 quickly generate code
Null pointer error:
Whether to instantiate, whether there is a null pointer, there is no more than life cycle, or scope.
Anonymous inner class. Instantiate in the form of an interface
JMenuItem
JMenu
JMenuBar
First do a menubar, which put is the menu, if it is a level two menus in the restaurant put menu, if the node is put JMenuItem bar
Then use addActionListener.
You can also use class Frame1 extends JFrame implements actionlistener{}
1Class Frame1Extends JFrameImplementsactionlistener{2Publicvoid actionperformed (ActionEvent Argo) { 3 Object Objsource = Argo.getsource (); (JComponent) Objsource; 5 if (Com.getname (). Equals ("Regist" 6 { 7 } 8 else if (Com.getname (). Equals (" 9 10 11 12}
Java 2014-12-03 Li Shuning