Solved

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

Posted on 2003-11-15
9
1,198 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
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
What is Python programming? 3 115
Rubik's Cube Code for Effective Presentation 3 54
Need help making a program or form for inventory that exports to txt 8 41
Help Required 3 98
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 …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…

825 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