Senin, 22 Juli 2024

Java Swing Frame Window 1

Java Swing is used to develop Graphical User Applications (GUI), desktop-based applications. Swing is built solely in Java and built on top of the AWT (abstract windowing toolkit). Swing is GUI widget toolkit for Java. Java Swing is part of Java Foundation Classes.

Type this following java programming code on your java programming IDE:

import javax.swing.JFrame;
public class Swing_implement{
/**
* Create the GUI and show it.
*/
private static void createGUI() {
//Create the window.
JFrame frame = new JFrame("Swing implementation");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//Display the window.
frame.pack();
frame.setSize(300,150);
frame.setVisible(true);
}
public static void main(String[] args) {
//Schedule a job for the event-dispatching thread:
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createGUI();
}
});
}
}

Result

Java Swing JFrame Window
Java Swing JFrame Window

Bibliography:

https://docs.oracle.com/
https://uny.ac.id/ ( university )
https://www.java-examples.com/

gui, Graphical User Interface (GUI), Java form window, jfc, Java Foundation Class (JFC), swing package, api, Application Programming Interface (API), Java swing

Related Post:


Tidak ada komentar:

Posting Komentar

Various Other Posts