corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » quick java help


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author quick java help
Tantastic
Member

Registered: 23rd Jan 07
User status: Offline
6th Mar 07 at 21:59   View User's Profile U2U Member Reply With Quote

very simple piece of code below. basically as it stands the check boxes are just placed in the applet.

how do i set the location of it to say 100 across and 500 down, thanks


import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;

public class BackgroundColor extends Applet implements ItemListener
{
private CheckboxGroup c;
private Checkbox red, orange, yellow;

public void init()
{
c = new CheckboxGroup();

red = new Checkbox("Red", c, false);
add(red);
red.addItemListener(this);

orange = new Checkbox("Orange", c, true);
add(orange);
orange.addItemListener(this);

yellow = new Checkbox("Yellow", c, false);
add(yellow);
yellow.addItemListener(this);
}

public void itemStateChanged(ItemEvent e)
{
if(e.getSource() == red)
setBackground(Color.RED);
if(e.getSource() == orange)
setBackground(Color.ORANGE);
if(e.getSource() == yellow)
setBackground(Color.YELLOW);




}
}

 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
What Java Compiler Is Standard? Mikorsa16v Geek Day 2 1273
13th Mar 03 at 16:02
by Mikorsa16v
 
help computer boffs groom Geek Day 33 2904
13th Nov 03 at 21:00
by Tim
 
How do you use the java multi upload thing jr General Chat 23 1324
25th Jun 06 at 14:35
by Gaz
 
Java help gavin18787 Geek Day 7 982
28th Feb 07 at 19:42
by _Allan_
 

Corsa Sport » Message Board » Off Day » Geek Day » quick java help 29 database queries in 0.2073331 seconds