fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. // your code goes here
  13. }
  14. }
Success #stdin #stdout 0.11s 52440KB
stdin
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);
        });
    }
}
stdout
Standard output is empty