package com.fc.vrml.image.ptg; import java.awt.*; import java.awt.event.*; public class ComponentChoiceDialog extends Dialog implements ActionListener{ public Button onebutton, twobutton, threebutton, fourbutton; public GridLayout gridlayout; PixelTextureGenerator parent; public int state; public ComponentChoiceDialog(PixelTextureGenerator parent){ super(parent, "Select number of components.", true); parent=parent; gridlayout=new GridLayout(1, 4); setLayout(gridlayout); onebutton=new Button("One"); twobutton=new Button("Two"); threebutton=new Button("Three"); fourbutton=new Button("Four"); add(onebutton); add(twobutton); add(threebutton); add(fourbutton); onebutton.addActionListener(this); twobutton.addActionListener(this); threebutton.addActionListener(this); fourbutton.addActionListener(this); setSize(240, 80); } public void actionPerformed(ActionEvent actionEvent){ if (actionEvent.getSource()==onebutton) state=1; if (actionEvent.getSource()==twobutton) state=2; if (actionEvent.getSource()==threebutton) state=3; if (actionEvent.getSource()==fourbutton) state=4; setVisible(false); } }