Next page | Contents page |

JScrollPane & JTabbedPane

If you have a lot of content to go in a window you may want to either scroll it or provide tabs for the user. These two Swing classes are containers for doing such things. Quite easy to use. Eg, just one extra line for scrolling:

	Container c = jframe.getContentPane ();
	JScrollPane scrollPane = new JScrollPane (this);
		//assumes this is a JComponent, we will paint
	c.add (scrollPane); // instead of c.add (this)

then the paint () method is exactly as before (as in Sheet, for example).

Next page | Contents page |