» »

java-netbeans-ponovno

java-netbeans-ponovno

trauca ::

živjo,
imam nov problem in sicer imam v zgornjem delu programa podajoč meni z submeniji(podobno kot v spletnem brskalniku FILE,EDIT,VIEW,HISTORY...), spodaj pa imam jPannel kateri bi se mogel na klik na določen submeni spremeniti...kako naj to naredim???

SLIKA :

KODA:
package fitnes;

/**
*
* @author trauca
*/
public class Okno extends javax.swing.JFrame {

/** Creates new form Okno */
public Okno() {
initComponents();
}

/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")

private void initComponents() {

jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jTextField1 = new javax.swing.JTextField();
jTextField2 = new javax.swing.JTextField();
jTextField3 = new javax.swing.JTextField();
jTextField4 = new javax.swing.JTextField();
jTextField5 = new javax.swing.JTextField();
jComboBox1 = new javax.swing.JComboBox();
jComboBox2 = new javax.swing.JComboBox();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
jMenuItem1 = new javax.swing.JMenuItem();
jMenuItem2 = new javax.swing.JMenuItem();
jMenuItem3 = new javax.swing.JMenuItem();
jMenuItem4 = new javax.swing.JMenuItem();
jMenu2 = new javax.swing.JMenu();
jMenuItem5 = new javax.swing.JMenuItem();
jMenuItem6 = new javax.swing.JMenuItem();
jMenuItem7 = new javax.swing.JMenuItem();
jMenuItem8 = new javax.swing.JMenuItem();
jMenu3 = new javax.swing.JMenu();
jMenu4 = new javax.swing.JMenu();
jMenu5 = new javax.swing.JMenu();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setBackground(new java.awt.Color(153, 255, 255));

jPanel1.setBackground(new java.awt.Color(198, 225, 252));
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(""));

jLabel1.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel1.setText("Vpis novega člana");

jLabel2.setText("Ime:");

jLabel3.setText("Priimek:");

jLabel4.setText("Spol:");

jLabel5.setText("Datum rojstva:");

jLabel6.setText("Status:");

jLabel7.setText("Trener:");

jLabel8.setText("Dejavnost:");

jButton1.setText("Potrdi");

jButton2.setText("Zbriši");

jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Moški", "Ženski" }));

jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Dijak / Študent", "Odrasel", "Upokojenec" }));

javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap(97, Short.MAX_VALUE)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 196, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(91, 91, 91))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jButton1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jButton2))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel2)
.addComponent(jLabel3)
.addComponent(jLabel4)
.addComponent(jLabel5)
.addComponent(jLabel6)
.addComponent(jLabel8)
.addComponent(jLabel7))
.addGap(47, 47, 47)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jTextField5)
.addComponent(jTextField4)
.addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 226, Short.MAX_VALUE)
.addComponent(jTextField2)
.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField3))))
.addContainerGap(29, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel6)
.addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(21, 21, 21)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel7)
.addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel8)
.addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton2)
.addComponent(jButton1))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);

jMenuBar1.setBackground(new java.awt.Color(153, 204, 255));

jMenu1.setBackground(new java.awt.Color(153, 204, 255));
jMenu1.setText("Vpis");

jMenuItem1.setBackground(new java.awt.Color(102, 153, 255));
jMenuItem1.setText("Vpis novega člana");
jMenu1.add(jMenuItem1);

jMenuItem2.setBackground(new java.awt.Color(102, 153, 255));
jMenuItem2.setText("Vpis novega izdelka");
jMenu1.add(jMenuItem2);

jMenuItem3.setBackground(new java.awt.Color(102, 153, 255));
jMenuItem3.setText("Vpis novega trenerja");
jMenu1.add(jMenuItem3);

jMenuItem4.setBackground(new java.awt.Color(102, 153, 255));
jMenuItem4.setText("Vpis nove dejavnosti");
jMenu1.add(jMenuItem4);

jMenuBar1.add(jMenu1);

jMenu2.setBackground(new java.awt.Color(153, 204, 255));
jMenu2.setText("Evidenca");

jMenuItem5.setBackground(new java.awt.Color(102, 153, 255));
jMenuItem5.setText("Registiranih članov");
jMenu2.add(jMenuItem5);

jMenuItem6.setBackground(new java.awt.Color(102, 153, 255));
jMenuItem6.setText("Izdelkov na zalogi");
jMenu2.add(jMenuItem6);

jMenuItem7.setBackground(new java.awt.Color(102, 153, 255));
jMenuItem7.setText("Trenerjev");
jMenu2.add(jMenuItem7);

jMenuItem8.setBackground(new java.awt.Color(102, 153, 255));
jMenuItem8.setText("Dejavnosti");
jMenu2.add(jMenuItem8);

jMenuBar1.add(jMenu2);

jMenu3.setBackground(new java.awt.Color(153, 204, 255));
jMenu3.setText("Izstavi račun");
jMenuBar1.add(jMenu3);

jMenu4.setBackground(new java.awt.Color(153, 204, 255));
jMenu4.setText("Vizitka");
jMenuBar1.add(jMenu4);

jMenu5.setBackground(new java.awt.Color(153, 204, 255));
jMenu5.setText("Zapri ");
jMenu5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jMenu5.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
jMenuBar1.add(jMenu5);

setJMenuBar(jMenuBar1);

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);

pack();
}

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Okno().setVisible(true);
}
});
}

// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JComboBox jComboBox1;
private javax.swing.JComboBox jComboBox2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JMenu jMenu1;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenu jMenu3;
private javax.swing.JMenu jMenu4;
private javax.swing.JMenu jMenu5;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JMenuItem jMenuItem1;
private javax.swing.JMenuItem jMenuItem2;
private javax.swing.JMenuItem jMenuItem3;
private javax.swing.JMenuItem jMenuItem4;
private javax.swing.JMenuItem jMenuItem5;
private javax.swing.JMenuItem jMenuItem6;
private javax.swing.JMenuItem jMenuItem7;
private javax.swing.JMenuItem jMenuItem8;
private javax.swing.JPanel jPanel1;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
private javax.swing.JTextField jTextField3;
private javax.swing.JTextField jTextField4;
private javax.swing.JTextField jTextField5;
// End of variables declaration

}

Nuke_H2 ::

mislm da morš za vsak zadevo nov class nardit? oz nov JPannel?

Lp H2O


Vredno ogleda ...

TemaSporočilaOglediZadnje sporočilo
TemaSporočilaOglediZadnje sporočilo
»

[Netbeans-Java]Embossing,blurring,sharpening

Oddelek: Programiranje
71135 (1037) t3hn0
»

[Java] Ne zažene appleta

Oddelek: Programiranje
51208 (1141) iggy
»

[Java] Zagon appleta v HTML

Oddelek: Programiranje
161541 (1363) Bela01
»

[JAVA] branje iz datoteke

Oddelek: Programiranje
242409 (2044) Bela01
»

[NALOGA][Java] Težave pri pisanju slikarja

Oddelek: Programiranje
202290 (1932) l0g1t3ch

Več podobnih tem