-
Empty JFrame
Hello all;
I am trying to display an email message using Swing. The code is
straight from Sun's tutorial, but I'm still getting a blank JFrame.
The message is retrieved without a problem. I can print it out with
System.out.println, so I am sure it retrieves the message, but it's in
HTML format, so I want to use a JEditorFrame as follows:
if (message[i].getContentType().equals("TEXT/HTML;
charset=iso-8859-1")) {
// This returns true!
String content = (String)message[i].getContent();
JFrame frame = new JFrame();
JEditorPane text = new JEditorPane("text/html", content);
text.setEditable(false);
JScrollPane pane = new JScrollPane(text);
frame.getContentPane().add(pane);
frame.setSize(300, 300);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.show();
Any ideas as to why the frame is blank?
Thanks for any help.
Steve
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks