MSTU5031/Oberon

From Studyplace

Jump to: navigation, search
import javax.swing.*;
import java.awt.*;
 
public class Oberon extends JFrame
{
 
	public static void main(String[] args)
	{
		Oberon myOberon = new Oberon();
		//myOberon.setVisible(true);
	}
 
	public Oberon()
	{
 
		setSize(1000,1000);
 
		Icon faceIcon = new ImageIcon ("xmen.jpg");
		JLabel face = new JLabel(faceIcon);
		add(face,BorderLayout.NORTH);
 
		JRadioButton storm = new JRadioButton("I like Storm.");
		JRadioButton col = new JRadioButton("I like Colossus.");
		JRadioButton night = new JRadioButton("I like Nightcrawler.");
		JRadioButton X = new JRadioButton("I like Professor X.");
		JRadioButton cyclops = new JRadioButton("I like Cyclops.");
		JRadioButton wolverine = new JRadioButton("I like Wolverine.");
 
		JPanel west = new JPanel();
		JPanel center = new JPanel();
		JPanel east = new JPanel();
 
		west.add(storm);
		west.add(col);
		center.add(night);
		center.add(X);
		east.add(cyclops);
		east.add(wolverine);
 
		add(west,BorderLayout.WEST);
		add(center,BorderLayout.CENTER);
		add(east,BorderLayout.EAST);
		pack();
		setVisible(true);
 
	}
}
Personal tools