Eight buttons: four each in two panels

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); 
      } 
} 
**************************

Permanent link to this article: http://bangla.sitestree.com/eight-buttons-four-each-in-two-panels/

Leave a Reply