Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java create window

//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);
  }
}
Comment

how to make window in java

//It is easy
//Don't forget to mention package or it will cause error
import javax.swing.*;

public class coder83 {
  public static void main(String[] args){
    JFrame firstFrame = new JFrame();
//x and y are your wish
    firstFrame.setsize(y,x);
    firstFrame.setTitle("Coder83");
//It is important or else your window won't clode
    firstFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
 
    firstFrame.setVisible(true);
  }}
    
Comment

java create window



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.
    }
}


Comment

PREVIOUS NEXT
Code Example
Java :: webview dark mode android 
Java :: null java 
Java :: java get number at the end of string 
Java :: Android listen to network change 
Java :: java do while loop 
Java :: java instanceof operator 
Java :: java stream add to existing list 
Java :: java string loop backwards 
Java :: convert integer arraylist to array java 
Java :: double number java 
Java :: LRU Cache java 
Java :: java string util if empty default 
Java :: java int 0/0 
Java :: java scanner next() 
Java :: getter in java 
Java :: uml to java 
Java :: java how to split a string to array 
Java :: set decimal point in java 
Java :: path in spring form 
Java :: positive numbers in array 
Java :: GridLayout 
Java :: Java char Keyword 
Java :: enum class in java 
Java :: list of arrays 
Java :: |= java operation 
Java :: String to java.sql.Date 
Java :: how todo a timeout test java 
Java :: empty map entry java 
Java :: how to create a sublist in java 
Java :: influx cli with docker container 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =