Java Reference
In-Depth Information
boldCB = new JCheckBox("Bold");
italicCB = new JCheckBox("Italic");
redRB = new JRadioButton("Red");
greenRB = new JRadioButton("Green");
blueRB = new JRadioButton("Blue");
fontFaceDD = new JComboBox(fontNames);
fontFaceDD.setMaximumRowCount(3);
boldCB.setSize(80, 30);
italicCB.setSize(80, 30);
redRB.setSize(80, 30);
greenRB.setSize(80, 30);
blueRB.setSize(80, 30);
fontFaceDD.setSize(80, 30);
boldCB.setLocation(100, 70);
italicCB.setLocation(100, 150);
redRB.setLocation(300, 70);
greenRB.setLocation(300, 110);
blueRB.setLocation(300, 150);
fontFaceDD.setLocation(200, 70);
boldCB.addItemListener( this );
italicCB.addItemListener( this );
redRB.addItemListener( this );
greenRB.addItemListener( this );
blueRB.addItemListener( this );
fontFaceDD.addItemListener( this );
c.add(boldCB);
c.add(italicCB);
c.add(redRB);
c.add(greenRB);
c.add(blueRB);
c.add(fontFaceDD);
ColorSelectBGroup = new ButtonGroup();
ColorSelectBGroup.add(redRB);
ColorSelectBGroup.add(greenRB);
ColorSelectBGroup.add(blueRB);
1
2
}
public void paint(Graphics g)
{
super .paint(g);
g.setColor(Color.orange);
g.drawRoundRect(75, 50, 324, 140, 10, 10);
g.drawLine(183, 50, 183, 190);
g.drawLine(291, 50, 291, 190);
Search WWH ::




Custom Search