codice:
public class FirstUsePanel extends javax.swing.JPanel {
private JButton jButton1,jButton2;
private JLabel jLabel1,jLabel2,jLabel3;
private JSeparator jSeparator1;
private MainFrame index;
private final JPanel myself=this;
private final int PANEL_WIDTH=515, PANEL_HEIGTH=80;
public FirstUsePanel(MainFrame index) {
// COSTRUTTORE
this.index=index;
this.setSize(PANEL_WIDTH, PANEL_HEIGTH);
initComponents();
}
private void initComponents() {
jLabel1 = new JLabel();
jLabel2 = new JLabel();
jLabel3 = new JLabel();
jSeparator1 = new JSeparator();
jButton1 = new JButton();
jButton2 = new JButton();
jLabel1.setIcon(new ImageIcon("images\\crypto_icon.JPG"));
jLabel2.setText("WELCOME !!!");
jLabel3.setText("Click Next to continue the installation or Cancel to exit setup ");
jButton1.setText("Next");
jButton2.setText("Cancel");
jButton1.requestFocus(); /* NON FUNZIONA :( */
/* QUESTO IN BASSO É IL CODICE DI LAYOUT GENERATO DA NetBeans */
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout); layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup() .addContainerGap()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 122,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 196,
javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jSeparator1,
javax.swing.GroupLayout.PREFERRED_SIZE, 154,
javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel3)))
.addGroup(layout.createSequentialGroup() .addGap(44, 44, 44)
.addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 102,
javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(34, 34, 34)
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 102,
javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(45,
Short.MAX_VALUE)) ); layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup() .addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup() .addComponent(jLabel1,
javax.swing.GroupLayout.PREFERRED_SIZE, 147,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup() .addComponent(jLabel2,
javax.swing.GroupLayout.PREFERRED_SIZE, 29,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10,
javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18)
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 30,
Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton2) .addComponent(jButton1)) .addGap(28, 28, 28)))) ); }