“Java erstellen Fenster” Code-Antworten

Java erstellen Fenster

//THIS IS A FIX OF THE ONE BY FRANCY FROG
//THEY FIXED THEIRS
import javax.swing.JFrame;

public class example {
  public static void main(String[] args){
    JFrame frame = new JFrame();
    frame.setSize(100,100);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setTitle("Example Frame");
    frame.setVisible(true);
  }
}
Rabid Goose

Java erstellen JFrame

import javax.swing.JFrame;

public class example {
  public static void main(String[] args){
    JFrame frame = new JFrame();
    frame.setSize(100,100);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOES);
    frame.setTitle("Example Frame");
    frame.setVisible(true);
  }
}
Fancy Frog

Java erstellen Fenster



public interface WindowConfigurer {
    void configure(JFrame window);
}

public class DefaultWindowConfigurer implements WindowConfigurer {

    private Font font = // Default font

    public void configure(JFrame window) {
        window.setFont(font);
    }

    public void setFont(Font font) {
        this.font = font;
    }
}

public class EntryPoint {
    public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                Something something = new Something();
                WindowConfigurer windowConfigurer = new DefaultWindowConfigurer();
                windowConfigurer.configure(something);
                something.setVisible(true);
            }
        });
    }
}

public class Something extends JFrame {
    public Something() {
        // .. add buttons, controls, etc.
    }
}


Xenophobic Xenomorph

Ähnliche Antworten wie “Java erstellen Fenster”

Fragen ähnlich wie “Java erstellen Fenster”

Weitere verwandte Antworten zu “Java erstellen Fenster” auf Java

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen