hw7Fall10 - JSplitPane class(defined in javax.swing...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
JSplitPane class (defined in javax.swing package) -An object of the JSplitPane class is a pane split vertical direction or horizontal direction. Suppose that we have component objects comp1 and comp2. If we want to add them using vertical split, we can do: JSplitPane sPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, comp1, comp2);
Background image of page 1

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

View Full DocumentRight Arrow Icon
Font class (java.awt package) One of the Font’s constructor is define as: Font(String name, int style, int size) Style can be Font.PLAIN, Font.BOLD, Font.ITALIC, or combination of them. Example: Font font1 = new Font("TimesRoman", Font.PLAIN, 16); If comp is a component object, we can set its font as follows: comp.setFont(font1);
Background image of page 2
A GUI Example using JRadioButton: // QuoteOptions.java // It demonstrates the use of radio buttons. import javax.swing.*; public class QuoteOptions extends JApplet { private final int WIDTH = 300, HEIGHT = 100; public void init() { QuoteGUI gui = new QuoteGUI(); getContentPane().add(gui); setSize(WIDTH,HEIGHT); } } // end of QuoteOptions class
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/09/2010 for the course CSE 71682 taught by Professor Nakamura during the Spring '10 term at ASU.

Page1 / 3

hw7Fall10 - JSplitPane class(defined in javax.swing...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online