{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

21-07apr10GUIlistening

21-07apr10GUIlistening - L is t e n in g t o e v e n t s o...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
1 1 Listening to events on GUIs Sec. 17.4 contains this material. Corresponding lectures on ProgramLive CD is a better way to learn the material. Top finalists from a real-life “Dilbert quotes contest” As of tomorrow, employees will be able to access the building only using individual security cards. Pictures will be taken next Wednesday and employ- ees will receive their cards in two weeks." (Fred Dales, Microsoft) I need an exact list of specific unknown problems we might encounter. (Lykes Lines Shipping) Email is not to be used to pass on information or data. It should be used only for company business. (Accounting manager, Electric Boat Company) This project is so important, we can't let things that are more important interfere with it. (Advertising/Marketing manager, United Parcel Service) Doing it right is no excuse for not meeting the schedule. (Plant manager, Delco Corporation) 2 Layout manager: An instance controls the placement of components JFrame layout manager default : BorderLayout. BorderLayout layout manager: Can place 5 components: South East West Center North Container cp= getContentPane(); JButton jb= new JButton(“Click here”); JButton jl= new JLabel( “label 2”); cp.add(jb, BorderLayout.EAST); cp.add(jl, BorderLayout.WEST); pack(); setVisible( true ); Place this in a constructor of a subclass of JFrame 3 Layout manager: An instance controls the placement of components JPanel layout manager default : FlowLayout. Box layout manager default: BoxLayout. Container cp= getContentPane(); JPanel p= new JPanel(); JButton b= new JButton("Click here"); JLabel jl= new JLabel("label 2"); p.add(b); p.add(jl); cp.add(p, BorderLayout.CENTER); pack(); setVisible(true); Place this in a constructor of a subclass of JFrame Components are placed in a row in the order in which they were added. With FlowLayout, if the window is too narrow, components flow into the next row(s). With BoxLayout, they don’t.
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}