Well, what you need to do is create a thin text / code (Note Pad ++ or Notepad) and remember the name.
Then open its type
import java.awt.*; import javax.swing.*;
This basically suggests that java gets java.awt and javax.swing from its various code libraries that come with java when it is loaded (understandably, since this is a language that helps developers).
Then you need to make your own function, which will have everything from size, text inside, color, etc. REMEBER, we do not code gui here, as it was already done when we imported the import java.awt.*; and javax.swing.*
When I put the public class work , I work on the name of my file (if it was called by code, it would be public class code .
public class work { private static void createWindow() {
Remember that you didn’t call a function anywhere, you basically expected it there until it was called.
public static void main(String[] args) {
This tells the computer what it will someday be when you run the program.
So, inside this you need to put
createWindow();
Since this is what you called your function above, and it calls the function, you do not need to call this function as it is when the program starts.
source share