Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #19192
| From | Knute Johnson <nospam@knutejohnson.com> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Object message? |
| Date | 2012-10-08 13:00 -0700 |
| Organization | A noiseless patient Spider |
| Message-ID | <k4vbcg$vs6$1@dont-email.me> (permalink) |
| References | <9621cdc5-4aa4-4057-894f-93ef69915871@googlegroups.com> |
On 10/8/2012 12:52 PM, bob smith wrote:
> Can someone tell me why "message" is an Object here in javax.swing.JOptionPane?
>
> Why isn't it a String?
>
> showMessageDialog
> public static void showMessageDialog(Component parentComponent,
> Object message)
> throws HeadlessException
> Brings up an information-message dialog titled "Message".
>
import java.awt.*;
import javax.swing.*;
public class test8 {
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
JLabel l = new JLabel("Because I'm an Object");
JOptionPane.showMessageDialog(null,l);
}
});
}
}
--
Knute Johnson
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Object message? bob smith <bob@coolfone.comze.com> - 2012-10-08 12:52 -0700
Re: Object message? Arne Vajhøj <arne@vajhoej.dk> - 2012-10-08 15:58 -0400
Re: Object message? Knute Johnson <nospam@knutejohnson.com> - 2012-10-08 13:00 -0700
Re: Object message? Eric Sosman <esosman@comcast-dot-net.invalid> - 2012-10-08 16:13 -0400
Re: Object message? Roedy Green <see_website@mindprod.com.invalid> - 2012-10-09 02:11 -0700
Re: Object message? Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2012-10-09 23:46 +0200
Re: Object message? Lew <lewbloch@gmail.com> - 2012-10-09 16:01 -0700
csiph-web