Java 10#: How to Make A JFrame

//Programmer:Akinwale Owi
//Program Purpose: How to Build A JFrame
//Company:Dagba Computers

//package name
package dagba.computers;

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

//class name
public class DagbaComputers

//private class where I build the GUI
private static void buildingJFrame ()

JFrame frame = new JFrame(“Dagba Sample JFrame”); //Frame Heading
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //What happens when the frame closes

//Setting frame dimensions
frame.setPreferredSize(new Dimension (400, 400));

frame.setVisible(true); //So we can see the frame


//main function
public static void main(String[] args)
javax.swing.SwingUtilities.invokeLater (new Runnable ()
public void run ()
//The Function
buildingJFrame();//Function where we built the Frame in

}//End of main function

}//end of DagbaComputers Class

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s