Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to make a JInternalFrame inside an applet appear in a browser

Posted on 2003-11-15
9
Medium Priority
?
1,214 Views
Last Modified: 2010-08-05
Can I use a Frame or a JInternalFrame in a applet?  How can I visualize an applet with a Frame or JInternalFrame in a browser?

I do have a JInternalFrame in an applet.  When I run it in an appletviewer it appear OK, with all its JMenuBar, JMenu and JMeniItem.  But whem a run it in a browser it does not appear at all, just a blanked space.  

0
Comment
Question by:jmvargas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
9 Comments
 
LVL 1

Accepted Solution

by:
spearman123 earned 250 total points
ID: 9758650
you need to make it a sub of a JFrame.. so like
JFrame.JInternalFrame
0
 

Author Comment

by:jmvargas
ID: 9766085
Dear Spearman123,

I am just leaving on vacation and I will be back on 28th november when I will analyse your remarks.  But at this moment your comment is not clear to me.  I do not Know what to do.  I am new in java. Could you be more clear for my understanding?  Thank you.
0
 
LVL 1

Expert Comment

by:spearman123
ID: 9768218
havent programmed java in over a year.. but you gotta do like
JInternalFrame = new JFrame.newInternalFrame("blah",10,10);
or something like that
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:jmvargas
ID: 9843110
Below is a code of a simple applet with a JInternalFrame or a JLabel.  If the JLabel is on(without comment) the Applet Viewer shows the label.   But if the JInternalFrame is on, the Applet Viewer will not show the JInternalFrame.  Both the .class and .html is in the same directory.

The .html file is as simple as:
<html><head></head>
<body>
<applet code=TesteJInternalFrame.class with=400 height=300></applet>
</body></html>

If you run this html file above with JLabel on it will show the label.  But if the JInternalFrame is on it will show just a grey space(400x300).

WHAT I HAVE TO DO TO SEE THE JInternalFrame running in a browser

import javax.swing.*;
import java.applet.*;
import java.awt.*;

public class TesteJInternalFrame extends JApplet {
  JInternalFrame frame;      

  public void init() {
  setName("JInternalFrame");
  setSize(400,300);
//  JLabel label = new JLabel("LABEL");
  frame  =  new JInternalFrame("JInternalFrame Created in Applet");
  Container c = getContentPane();
  c.add(frame);
//  c.add(label);
  }
}
0
 
LVL 1

Expert Comment

by:spearman123
ID: 9843143
JInternalFrame extends JFrame
0
 

Author Comment

by:jmvargas
ID: 9854444
What I do want is an APPLET and not an standalone program.  If my class TesteJInternalFrame extends JFrame The applet does not exist anymore.

Please, take my example described above and tell me how to see that applet in a browser.
0
 

Author Comment

by:jmvargas
ID: 10963009
Sorry by them long time answer.  I accept the answer and doing that I think I closed the question.  Thank you.
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Progress

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question