import javax.swing.*;
import java.awt.*;
public class WelcomeFrame extends JFrame {
public WelcomeFrame() {
// إعدادات الإطار
setTitle("Welcome Frame");
setSize(300, 200);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLocationRelativeTo(null); // مركز الإطار على الشاشة
// إنشاء لوحة جديدة
JPanel panel = new JPanel();
panel.setBackground(Color.WHITE); // تعيين لون خلفية اللوحة
// إنشاء نص بخط مائل
JLabel welcomeLabel = new JLabel("Welcome");
welcomeLabel.setFont(new Font("Arial", Font.ITALIC, 24)); // تعيين الخط ليكون مائلاً وحجمه 24
welcomeLabel.setForeground(Color.BLUE); // تعيين لون النص
// إضافة النص إلى اللوحة
panel.add(welcomeLabel);
// إضافة اللوحة إلى الإطار
add(panel);
}
public static void main(String[] args) {
// إنشاء إطار جديد وإظهاره
SwingUtilities.invokeLater(() -> {
WelcomeFrame frame = new WelcomeFrame();
frame.setVisible(true);
});
}
}