المجلس اليمني ... يمن واحد وآراء متعددة
::  قوانين المنتدى  |   طلب رقم التنشيط   |   تنشيط العضوية  |  استعادة كلمة المرور
العودة   المجلس اليمني :: العلمية والتقنية :: الكمبيـوتر والانتـرنت :: المواقع ولغات البرمجة والشبكات
|
 
أدوات الموضوع
قديم 15-03-2005, 05:15 PM   مشاركة رقم : 1
عضو متميّز
 
لا توجد صورة

 
تاريخ التسجيل: 18-06-2003
المشاركات: 1,007

افتراضي Applet !!!!Applet

how to show message box in applet
some one help me
if you know please write code only
thank's agin

  رد مع اقتباس
قديم 17-03-2005, 12:19 AM   مشاركة رقم : 2
قلم فضي
 
لا توجد صورة

 
تاريخ التسجيل: 04-05-2002
المشاركات: 3,202

افتراضي

ummmmm
I dont know what u mean exaxtally,
but try to use the JOptionPane class
It should work with Applet too
I ll be back

  رد مع اقتباس
قديم 17-03-2005, 02:31 AM   مشاركة رقم : 3
قلم فضي
 
لا توجد صورة

 
تاريخ التسجيل: 04-05-2002
المشاركات: 3,202

افتراضي

check out this applet
http://www.ic.sunysb.edu/stu/halgibha/Applet1.html
the code is simple if thats what u mean


كود:
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import javax.swing.JOptionPane;

public class Yemen extends Applet implements ActionListener {
    Button confirm = new Button("test 1 ");
    Button input = new Button("test 2");
    Button message = new Button("test 3");
    TextField text = new TextField("I hope u will like it: ");

    public void init() {
        setLayout(new GridLayout(4,1));
        confirm.addActionListener(this);
        add(confirm);
        input.addActionListener(this);
        add(input);
        message.addActionListener(this);
        add(message);
        text.setBackground(Color.CYAN);
        add(text);
    }

    public void actionPerformed(ActionEvent e) {
        Button b = (Button) e.getSource();
        if (b == confirm) {
            int i = JOptionPane.showConfirmDialog(this, "Do you really want to do that?");
            text.setText(i + "");
         } else if (b == input) {
            String s = JOptionPane.showInputDialog(this, "Your ID, please");
            text.setText(s);
         } else if (b == message) {
            JOptionPane.showMessageDialog(null, "Game Over!");
            text.setText("");
        }
    }
}

  رد مع اقتباس
إضافة رد

أدوات الموضوع

الانتقال السريع :::

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.