Академический Документы
Профессиональный Документы
Культура Документы
class HelloWorldApp {
public static void main(String[] args) {
System.out.println("Hello World!"); // Prints the string to the console.
}
}
import javax.swing.*;
class hello {
frame.setVisible(true);
}
}
USER INTERFACE
Text-Based UI Graphic-Based UI
CONTAINER
Un “container” est un component qui sert qui réceptacle à
d'autres containers ou un component.
Container 1
Container 2
Title Bar
Menu Bar
class SwingDemo {
SwingDemo() {
}
}
package trainingclass2;
import javax.swing.*;
import java.awt.*;
//frame.getContentPane().setLayout(new
FlowLayout(FlowLayout.RIGHT));
//frame.getContentPane().setComponentOrientation(ComponentOrientation.
RIGHT_TO_LEFT);
// frame.setBounds(50, 50, 200, 200);
frame.getContentPane().add(closeButton);
frame.getContentPane().add(helpButton);
frame.pack();
//frame.setLocationRelativeTo(null);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);