Solved

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

Posted on 2003-11-15
9
1,201 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 125 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
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 …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

734 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