السلام عليكم ورحمة الله وبركاته
اريد كتابة برنامج بلغة جفا الاسم على الشاشة مثلا(محمد)
-waf وشكرررررررررررررررررررررا
السلام عليكم ورحمة الله وبركاته
اريد كتابة برنامج بلغة جفا الاسم على الشاشة مثلا(محمد)
-waf وشكرررررررررررررررررررررا
السلام عليكم ورحمة الله وبركاته
اريد كتابة برنامج بلغة جافا يقوم يطباعة الاسم بالعربية على الشاشة مثلا(محمد)
وشكرررررررررررررررررررررا
و عليكم السلام ،
يجب عليك أخي أن تحاول أولا ، فأين محاولاتك ؟؟؟!!
المهم الحل أهوه بس متضراش، لازم تحاول الأول
import javax.swing.*;
import java.awt.*;
public class Print extends JFrame {
private String name;
// this method accepts input from user and assgin it to the variable name
// and the repaint() method calls the paint() method
public void acceptName (){
name = JOptionPane.showInputDialog (this, "Enter your name " );
//System.out.println (name );
repaint();
}
// this paint() method that displays the string on the screen, you can change the x and y to change the place of the word
public void paint (Graphics g ){
if ( name != null ){
g.drawString (name, 70, 70 );
//System.out.println ("paint");
}
}
public static void main (String[] args ){
Print p = new Print ();
p.setSize (300, 300 );
p.setVisible (true );
p.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE );
p.acceptName();
}
}مشكووووووووووووووووووووور
هذا الموضوع مغلق.