Solved

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

Posted on 2003-11-15
9
1,195 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
  • 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

920 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now