Answers for "create a display in java"

7

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);
  }
}
Posted by: Guest on May-21-2020
0

java making a screen

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

public class Screen{
    
    private GraphicsDevice graphicsDevice;
    
    public static void main(String[] args){
        
        Screen screen = new Screen();
    }
    public Screen(){
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        JFrame jFrame = new JFrame();
        
        MakeDefaultScreen(jFrame,screenSize);
        
        System.out.println("Program Started");
    }
    public void MakeDefaultScreen (JFrame jFrame,Dimension screenSize){
        jFrame.setSize(screenSize.width,screenSize.height);
        jFrame.setVisible(true);
        jFrame.setResizable(true);
    }
}
Posted by: Guest on May-22-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language