Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Myra WebTools - Desktop.java

Desktop.java

Caricato da: Ht-never
Scarica il programma completo

  1. import java.awt.Color;
  2. import javax.swing.*;
  3.  
  4. @SuppressWarnings("serial")
  5. public class Desktop extends JPanel {
  6.        
  7.         // variabili
  8.         JRadioButton b1 = new JRadioButton("Visual HTML Editor");
  9.         JRadioButton b2 = new JRadioButton("Text Editor");
  10.         JRadioButton b3 = new JRadioButton("Code Editor");
  11.         JRadioButton b4 = new JRadioButton("Other Tools");
  12.         ButtonGroup group = new ButtonGroup();
  13.        
  14.         public Desktop() {
  15.                
  16.                 // layout
  17.                 setLayout(null);
  18.                 add(b1); add(b2); add(b3); add(b4);
  19.                 group.add(b1); group.add(b2);
  20.                 group.add(b3); group.add(b4);
  21.                
  22.                 // colori
  23.                 b1.setBackground(Color.gray);
  24.                 b2.setBackground(Color.gray);
  25.                 b3.setBackground(Color.gray);
  26.                 b4.setBackground(Color.gray);
  27.                
  28.                 // bounds
  29.                 setupBounds();
  30.                 doLayout();
  31.         }
  32.         public void setupBounds() {
  33.                 b1.setBounds(20,40,140,40);
  34.                 b2.setBounds(20,80,140,40);
  35.                 b3.setBounds(20,120,140,40);
  36.                 b4.setBounds(20,160,140,40);
  37.         }
  38. }