Skip to content

Commit de90169

Browse files
committed
Update PT from Feedback
1 parent e3ae87a commit de90169

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

projects/set-up-a-gui-with-java/set-up-a-gui-with-java.mdx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ tags:
1818
cl="for-sidebar"
1919
/>
2020

21-
# Set up a GUI (Graphical User Interface) with Java
21+
# Set Up a GUI with Java
2222

2323
<AuthorAvatar
2424
author_name="Ellie Popoca"
@@ -40,15 +40,15 @@ tags:
4040

4141
GUI (Often pronounced "GOO-ee", but actually "Gee-Yuuu-Eye") stands for **graphical user interface**.
4242

43-
Back in the OLD, ANCIENT days of the 1980s, you had to be a knowledgeable tech person to really use computers, but thanks to graphical user interfaces, things like buttons, sliders, windows, and menus let your 5-year-old sibling pull up Roblox on their iPad!
43+
Back in the OLD, ANCIENT days of the 1980s, you had to be a knowledgeable tech person to really use computers, but thanks to graphical user interfaces, things like buttons, sliders, windows, and menus let your 5-year-old sibling pull up [Roblox](https://en.wikipedia.org/wiki/Roblox) on their iPad!
4444

4545
<ImageZoom src="https://i.imgur.com/wfJ167k.png" />
4646

4747
You use GUIs every day, and most commonly, web-based GUIs! As you can imagine, ChatGPT is a GUI, as it lets you prompt without ever interacting with code or the command line.
4848

4949
<ImageZoom src="https://i.imgur.com/TxEy5sO.png" />
5050

51-
## Swing GUI Toolkit
51+
## Setting Up
5252

5353
In Java development, you're able to create GUIs for your programs without needing any additional downloads! All you need is the **Swing** GUI Toolkit import statement in the IDE of your choice, and you're able to get started immediately!
5454

@@ -61,23 +61,23 @@ If you don't already have a Java IDE, Click [here]() to set yours up!
6161

6262
Create a public class and add a main method to begin.
6363

64-
You'll want to add a `JFrame` object with a title, and use methods like `.setSize`, `.setDefaultCloseOperation`, and `.setLayout` to set up your window screen.
64+
You'll want to add a `JFrame` object with a title, and use methods like `.setSize()`, `.setDefaultCloseOperation`, and `.setLayout` to set up your window screen.
6565

66-
Then, close your program with `frame.setVisible(true);` to see your interface!
66+
Then, close your program with `frame.setVisible(true)` to see your interface!
6767

6868
```java
6969
public class SimpleGUI {
70-
public static void main(String[] args) {
71-
72-
// Create a new window (JFrame)
73-
JFrame frame = new JFrame("My First GUI");
74-
frame.setSize(300, 150);
75-
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
76-
frame.setLayout(null); // absolute positioning
77-
78-
79-
frame.setVisible(true);
80-
}
70+
public static void main(String[] args) {
71+
72+
// Create a new window (JFrame)
73+
JFrame frame = new JFrame("My First GUI");
74+
frame.setSize(300, 150);
75+
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
76+
frame.setLayout(null); // absolute positioning
77+
78+
79+
frame.setVisible(true);
80+
}
8181
}
8282
```
8383

@@ -142,11 +142,11 @@ Now, we can see a name in our frame!
142142

143143
Congrats! You've made your very own GUI with Java's Swing GUI Toolkit. This is just the beginning of the possibilities of what you can build with Java; Games, forms, and image displays are now possible with Swing!
144144

145+
### More Resources
145146
Be sure to check out
146147
- [The Swing API Documentation](https://docs.oracle.com/javase/7/docs/api/javax/swing/package-summary.html) to see other methods and objects you can create for your GUI
147148
- [Setting up your local Java Development Environment]()
148149

149-
150150
Note that Swing is the default, built-in GUI Toolkit. Other toolkits like [JavaFX](https://openjfx.io/openjfx-docs/#install-javafx) exist with more functionality with their own SDK, or download package.
151151

152152
Other ideas include

0 commit comments

Comments
 (0)