Java GUI wird nicht angezeigt?

Hey,

ich bin gerade dabei ein Java GUI Programm zu entwerfen. Allerdings sehe ich keine Buttons oder sonstige Anwendungen auf der Oberfläche.

(Sorry wenn ich mich nicht fachmännisch ausdrücke, bin noch Anfänger)

Hier ein Ausschnit

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;

/**
  *
  * Beschreibung
  *
  * @version 1.0 vom 01.11.2016
  * @author 
  */

public class GUI extends JFrame {
  // Anfang Attribute
  private Canvas canvas1 = new Canvas();
  private JLabel jLabel1 = new JLabel();
  private JLabel jLabel2 = new JLabel();
  private JButton jButton1 = new JButton();
  private JButton jButton2 = new JButton();
  private JButton jButton3 = new JButton();
  private JButton jButton4 = new JButton();
  private JButton jButton5 = new JButton();
  private JButton jButton6 = new JButton();
  private JLabel jLabel3 = new JLabel();
  private JButton jButton7 = new JButton();
  private JButton jButton8 = new JButton();
  private JButton jButton9 = new JButton();
  private JTextField jTextField1 = new JTextField();
  private JButton jButton10 = new JButton();
  private JButton jButton11 = new JButton();
  private JLabel jLabel4 = new JLabel();
  private JButton jButton14 = new JButton();
  private JButton jButton12 = new JButton();
  private JButton jButton13 = new JButton();
  private JLabel jLabel5 = new JLabel();
  private JButton jButton15 = new JButton();
  private JButton jButton16 = new JButton();
  private JLabel jLabel6 = new JLabel();
  private JButton jButton17 = new JButton();
  private JButton jButton18 = new JButton();
  private JButton jButton19 = new JButton();
  // Ende Attribute
  
  public GUI() { 
    // Frame-Initialisierung
    super();
    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    int frameWidth = 415; 
    int frameHeight = 865;
    setSize(frameWidth, frameHeight);
    Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
    int x = (d.width - getSize().width) / 2;
    int y = (d.height - getSize().height) / 2;
    setLocation(x, y);
    setTitle("Formular");
    setResizable(false);
    Container cp = getContentPane();
    cp.setLayout(null);
    // Anfang Komponenten
    
    canvas1.setBounds(0, -8, 396, 828);
    cp.add(canvas1);
    jLabel1.setBounds(88, 24, 220, 28);
    jLabel1.setText("Dieser Text soll verändert werden");
    cp.add(jLabel1);
    jLabel2.setBounds(24, 72, 207, 20);
    jLabel2.setText("Aufgabe 1: Hintergrundfarbe ändern");
    cp.add(jLabel2);
    jButton1.setBounds(24, 104, 107, 25);
    jButton1.setText("Rot");
    jButton1.setMargin(new Insets(2, 2, 2, 2));
    jButton1.addActionListener(new ActionListener() { 
      public void actionPerformed(ActionEvent evt) { 
        jButton1_ActionPerformed(evt);
      }
    });

Danke im Voraus für alle Antworten

...zur Frage
Du hast keine Main Methode!

Du benötigst eine Main Methode welche ein Objekt der eigenen klasse erstellt, damit der Konstruktor aufgerufen wird.

public static void main(String[] args){
new GUI();
}
...zur Antwort
Weitere Inhalte können nur Nutzer sehen, die bei uns eingeloggt sind.