Answers for "sample jframe"

8

java create 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);
  }
}
Posted by: Guest on April-17-2020
2

java simple jframe example

import javax.swing.*;
import java.awt.FlowLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.*;
 
public class JFrameExample{
     
    public static void main(String[] args){
        // Create frame with title Registration Demo
        JFrame frame= new JFrame(); 
        frame.setTitle("JFrame Demo");
        frame.pack();
        frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
        frame.setLocationRelativeTo(null);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
    }
}
Posted by: Guest on December-31-2019

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language