is thier a messagebox in java like in vb ????? if so how do i use it ?
Printable View
is thier a messagebox in java like in vb ????? if so how do i use it ?
There is a message box method in Java, however it is only available when using Swing (I think).
Swing allows you to use graphical components in Java classes. If you want to know more about this goto:
http://java.sun.com/docs/books/tutorial/uiswing/
It's a Swing tutorial. However, if you are just doing it for debugging etc. I suggest ignoring it as it can be very slow. Also, it's rather a lot of possibly unnecessary hassle.
Hope it helps
HD
no its for user errors and for valadation
ok cool thanks for the tutorial but dose it have a name so can search for it ?
Sorry I forgot to say what the thing's called :rolleyes:
You can use the JOptionPane class (I think) and the method showMessageDialog(...). Have a look here:
http://java.sun.com/docs/books/tutor...ts/dialog.html
That should do it!
HD
COOOOOOl Thanks
can someone give me a working example ??("JBuilder")
Can't be sure if this will work - don't have chance to try it (supposed to be working :rolleyes: )
/* All imports here - java.swing.* and the like
*
..
*/
JFrame frame = new JFrame("My Window");
JOptionPane.showMessageDialog(frame, "This is my window");
http://java.sun.com/docs/books/tutor...ialogDemo.java
is an example of using frames and dialogs with Swing.
I've not done much so I haven't got any examples.
HD
ya i tryed to run that example but it wouldnt compile had errors
Ok i got it to work now thanks :-)
Code:import javax.swing.JApplet;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
public class Dialog extends JApplet
{
JFrame frame = new JFrame("My Window");
public Dialog()
{
JOptionPane.showMessageDialog(frame, "This is my window");
}
}