Solved

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

Posted on 2003-11-15
9
1,194 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
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 …
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…
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 …

706 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

13 Experts available now in Live!

Get 1:1 Help Now