🔒 Closed Java swing ( introduction )

Status
Not open for further replies.
Java GUI Framework awt, swing, javafx.
awt - is long dead.
swing - replaces awt but more or less dead since Javafx took over in 2008.
javafx - the current UI framework .

i would prefer learn java swing first, grasp the basic foundation of swing then go straight to javaFx.

in learning swing, pag aralan mo yung:
JFrame
JPanel
JLabel
JButton
and so on .
then Class Hierarchy and Inheritance (importante ito).

here's the basic example using java swing, displaying Hello World using JLabel .

import javax.swing.*;
public class HelloWorldSwing {
private static void createAndShowGUI() {
JFrame.setDefaultLookAndFeelDecorated(true); // works as of v1.4 you can remove this line
JFrame frame = new JFrame("HelloWorldSwing");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JLabel label = new JLabel("Hello World");
frame.getContentPane().add(label);
frame.pack();
frame.setVisible(true);
}
public static void main(String[] args) {
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}
});
}
}

Then in java IDE why not use Eclipse or Netbeans.
 
Status
Not open for further replies.

About this Thread

  • 3
    Replies
  • 709
    Views
  • 3
    Participants
Last reply from:
Game_Guardian18

Trending Topics

Online now

Members online
1,121
Guests online
3,740
Total visitors
4,861

Forum statistics

Threads
2,306,598
Posts
29,172,813
Members
1,193,944
Latest member
sinokayato
Back
Top