Login: password:
Forgot your password?
ButtonManager con textField > FinestraPrincipale > in depth
FinestraPrincipale
package buttonmanager;
import javax.swing.*;
import java.awt.*;
public class FinestraPrincipale extends JFrame{

  public static void main(String[ ] a){
        new FinestraPrincipale();
  }
  public FinestraPrincipale() {
      this.setSize(400,400);
      this.centerInScreen();
       // fai in modo che la chiusura della finestra
    // termini l'applicazione
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE );
    //
    this.setLayout(new BorderLayout());
    //
    ButtonPanel bp=new ButtonPanel();
    this.add(bp,BorderLayout.CENTER);
    ControlPanel cp= new ControlPanel(bp);
    this.add(cp,BorderLayout.SOUTH);
    bp.setControlPanel(cp);
    // rendi la finestra visibile
    this.setVisible(true);
  }

  private void centerInScreen() {
    // trova le dimensioni dello schermo e della finestra
    Dimension screenSize =
                 Toolkit.getDefaultToolkit().getScreenSize();
    Dimension frameSize = this.getSize();
    // assicurati che la finestra non sia più grande dello schermo
    if (frameSize.height > screenSize.height)
                 frameSize.height = screenSize.height;
    if (frameSize.width > screenSize.width)
                frameSize.width = screenSize.width;
    // centra la finestra nello schermo
    this.setLocation((screenSize.width - frameSize.width) / 2,
                (screenSize.height - frameSize.height) / 2);
  }
}

ButtonManager con textField > in depth


powered by segue
segue_logo