Hallo,
ich habe eine Oberfläche programmiert und möchte sie einfach nur öffnen (mit Umschalt+F6).
Ich weiß nicht wo der Fehler ist.
Vielen Dank im Vorraus.
Gruß Boern
ich habe eine Oberfläche programmiert und möchte sie einfach nur öffnen (mit Umschalt+F6).
Ich weiß nicht wo der Fehler ist.
Vielen Dank im Vorraus.
Gruß Boern
Code:
/*Oberfläche vom Messwert
*/
package test;
import javax.swing.*;
import java.awt.*;
public class Messwert extends javax.swing.JPanel {
public Messwert() {
initComponents();
System.out.println("gdgdfg");
// setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
}
/** 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.
*/
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
P_Sued = new javax.swing.JPanel();
L_Wert = new javax.swing.JLabel();
P_Messwert_oben = new javax.swing.JPanel();
L_Messwert = new javax.swing.JLabel();
P_Center = new javax.swing.JPanel();
L_Steuergeraet = new javax.swing.JLabel();
L_Steuergeraet_Nummer = new javax.swing.JLabel();
setBackground(new java.awt.Color(204, 204, 204));
jPanel1.setLayout(new java.awt.BorderLayout());
P_Sued.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
L_Wert.setFont(new java.awt.Font("Tahoma", 0, 24));
L_Wert.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
L_Wert.setText("0");
org.jdesktop.layout.GroupLayout P_SuedLayout = new org.jdesktop.layout.GroupLayout(P_Sued);
P_Sued.setLayout(P_SuedLayout);
P_SuedLayout.setHorizontalGroup(
P_SuedLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(P_SuedLayout.createSequentialGroup()
.add(229, 229, 229)
.add(L_Wert)
.addContainerGap(270, Short.MAX_VALUE))
);
P_SuedLayout.setVerticalGroup(
P_SuedLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(P_SuedLayout.createSequentialGroup()
.add(45, 45, 45)
.add(L_Wert)
.addContainerGap(54, Short.MAX_VALUE))
);
P_Messwert_oben.setBackground(new java.awt.Color(255, 255, 255));
P_Messwert_oben.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
L_Messwert.setFont(new java.awt.Font("Tahoma", 0, 24));
L_Messwert.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
L_Messwert.setText("Messwert");
org.jdesktop.layout.GroupLayout P_Messwert_obenLayout = new org.jdesktop.layout.GroupLayout(P_Messwert_oben);
P_Messwert_oben.setLayout(P_Messwert_obenLayout);
P_Messwert_obenLayout.setHorizontalGroup(
P_Messwert_obenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(P_Messwert_obenLayout.createSequentialGroup()
.add(189, 189, 189)
.add(L_Messwert)
.addContainerGap(221, Short.MAX_VALUE))
);
P_Messwert_obenLayout.setVerticalGroup(
P_Messwert_obenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(P_Messwert_obenLayout.createSequentialGroup()
.add(24, 24, 24)
.add(L_Messwert)
.addContainerGap(27, Short.MAX_VALUE))
);
L_Steuergeraet.setBackground(new java.awt.Color(255, 255, 255));
L_Steuergeraet.setFont(new java.awt.Font("Tahoma", 0, 24));
L_Steuergeraet.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
L_Steuergeraet.setText("Steuerger\u00e4t: ");
L_Steuergeraet_Nummer.setBackground(new java.awt.Color(255, 255, 255));
L_Steuergeraet_Nummer.setFont(new java.awt.Font("Tahoma", 0, 24));
L_Steuergeraet_Nummer.setText("0");
org.jdesktop.layout.GroupLayout P_CenterLayout = new org.jdesktop.layout.GroupLayout(P_Center);
P_Center.setLayout(P_CenterLayout);
P_CenterLayout.setHorizontalGroup(
P_CenterLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(P_CenterLayout.createSequentialGroup()
.add(144, 144, 144)
.add(L_Steuergeraet)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(L_Steuergeraet_Nummer)
.addContainerGap(210, Short.MAX_VALUE))
);
P_CenterLayout.setVerticalGroup(
P_CenterLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(P_CenterLayout.createSequentialGroup()
.add(35, 35, 35)
.add(P_CenterLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(L_Steuergeraet)
.add(L_Steuergeraet_Nummer))
.addContainerGap(41, Short.MAX_VALUE))
);
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(406, 406, 406)
.add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addContainerGap(108, Short.MAX_VALUE))
.add(org.jdesktop.layout.GroupLayout.TRAILING, P_Messwert_oben, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.TRAILING, P_Sued, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(P_Center, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(56, 56, 56)
.add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(P_Messwert_oben, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(P_Center, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(P_Sued, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
);
}// </editor-fold>
public static void main(String[] args) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Messwert().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JLabel L_Messwert;
private javax.swing.JLabel L_Steuergeraet;
private javax.swing.JLabel L_Steuergeraet_Nummer;
private javax.swing.JLabel L_Wert;
private javax.swing.JPanel P_Center;
private javax.swing.JPanel P_Messwert_oben;
private javax.swing.JPanel P_Sued;
private javax.swing.JPanel jPanel1;
// End of variables declaration
}