Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6155277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:24:34+00:00 2026-05-23T20:24:34+00:00

I have created a JApplet using the JUNG library in Netbeans that compiles and

  • 0

I have created a JApplet using the JUNG library in Netbeans that compiles and runs normally. However, when I try to create an html file that runs the applet, only a grey pane appears but the components are missing.
My class is :

   public class View extends JApplet {

   //Here I declare the buttons etc..

   public View()
{
    initializeComponent();
            fetchGraphs();

}


   public static void main(String[] args) throws IOException{

    f = new JFrame();
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    x = screenSize.width;
    y = screenSize.height;


    f.getContentPane().add(new View());
    f.setTitle("Social Network Privacy Settings and Access Control");
    f.setLocation(new Point(15, 20));
    f.setSize(new Dimension(x-20,y-50));
    f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    f.setResizable(false);

    f.setVisible(true);
}  
}

The method initializeComponent() adds all the components to the main window. I used JFrameBuilder to build some basic components. JFrameBuilder uses a method addComponent(container, component, x, y, width, height) to add components

I use the code below for that:

  contentPane = (JPanel)this.getContentPane();

  //to create the japplet contentpane

  addComponent(contentPane, genGraphButton, (int)(0.35*x),(int)(0.63*y),       
  (int)(0.2*x),28);

  // to add components

Then I create an html file:

    <applet code = 'MyPackage.View' 
    archive = 'MyProject.jar',
    width = 1600, 
    height = 800/>

in the /dist folder but then only a grey pane appears when I try to open it with Mozilla Firefox. The strange thing is that I have created another simple applet, this time with netbeans JBuilder and it runs normally in a web page.

I really need some help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T20:24:34+00:00Added an answer on May 23, 2026 at 8:24 pm

    You mention the JUNG library, it relies on the two third party libraries, Collections-Generic & Cern Colt Scientific Library 1.2.0. As mentioned by @othman they need to be added to the run-time class-path of the applet (added to the archive attribute of the applet element).

    But just so we are clear, make sure the HTML contains more than just the applet element. Something like this:

    <html>
    <body>
    <applet 
        code='MyPackage.View' 
        archive='MyProject.jar,jung.jar,collections.jar,colt-scientific.jar'
        alt='Java is DISABLED in this browser!'
        width='1600'
        height='800'>
    This browser does not recognize the applet element! 
    </applet>
    </body>
    </html>
    

    Of course, you’ll need to change the names of the last 3 Jars to their real names.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created some forms using zendframework on my local machine that send the
I have created a cookie using php and now I need to create a
I have created infopath form library in SharePoint sever2010. I am using Windows server
I have created a mac application using the WebView. But issue is that webView
I have created some web content using a HTML editor and am loading it
I have created a custom attribute in my asp.net MVC application using the following
I have created an iOS app that requires a user to link his/her Dropbox
I have created a custom dialog for Visual Studio Setup Project using the steps
I was curious if it was possible to create hotkeys in a jApplet that
Have created simple Ajax enabled contact forms before that have around 12 fields -

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.