mport java.applet.Applet; import java.awt.*;
***************************
/** Eight buttons: four each in two panels. * */
public class ButtonTest2 extends Applet {
public void init() {
String[] labelPrefixes = {
"Start", "Stop", "Pause", "Resume"
};
Panel p1 = new Panel(); for (int i=0; i<4; i++) {
p1.add(new Button(labelPrefixes[i] + " Thread1"));
}
Panel p2 = new Panel(); for (int i=0; i<4; i++) {
p2.add(new Button(labelPrefixes[i] + " Thread2"));
} add(p1); add(p2);
}
}
**************************
Similar Posts
Machine Learning, Big Data, Data Science, Analytics, Cloud, Security, AI, Robotics, Database, BI, Development: Software, Web, Mobile