Netbeans applet

the applet i've created isnt working in console mode....
giving error dat-"package org.jdesktop.layout" does not exist...
can ne1 help me ?
is it becoz dat this class is not included in java folder in progam files ?

Publish the needed gui jars with your applet
http://forum.java.sun.com/thread.jspa?threadID=738916
<param name=archive value="myApplet.jar, swing-layout-1.0.jar " />
Copy swing-layout-1.0.jar to the same folder as myApplet.jar

Similar Messages

  • Netbeans debugging an applet

    I have a class called JScriptBroker which extends Applet.
    I have a class SearchPeaple that extends JScriptBroker and therefore is an applet.
    How do I tell netbeans it is an applet because it keeps bugging me the main method is
    missing?
    Allso I cannot debug an applet that uses JSObject, this is because the applet cannot be
    run with the appletviewer. None of the html elements are visible in the appletviewer.
    Adding the applet to a jsp or html page in a web project doesn't solve the problem
    because breakpoints in the applet are ignored. The following is from the help of
    NetBeans
    Applets run in the virtual machine of the IDE's default web browser. The IDE uses a different virtual machine and therefore applets are not included in a web application's debug session.
    I havent used Netbeans for about 3 years now but I do remember it used to be
    possible to debug an applet in the html/jsp file of your choice. Does anybody know how to
    do this?

    Thanks for your reply, i see I made a mistake in my post
    Allso I cannot debug an applet that uses JSObject, this is because the applet cannot be
    run with the appletviewer. None of the html elements are visible in the appletviewer.
    should be
    Allso I cannot debug an applet that uses JSObject, this is because the applet cannot be
    run in inaything but the appletviewer. None of the html elements are visible in the appletviewer.
    About debugging an applet that extends a class that extends an applet:
    Opened a new java class library project in netbeans 4.0 using jre 1.5
    Added a class called AppletClass
    import java.applet.*;
    public class AppletClass extends Applet{
        public void init(){
            System.out.println("OK, this works");
    }Right clicked the file and choose debug, that works.
    Added a class called SubAppletClass that extends AppletClass
    Right clicked it and choose debug, the error is:
    Class "SubAppletClass" does not have a main method.

  • Applet only runs 50% of the time in Netbeans

    I run this application and 50% of the time it works and the other half it doesn't. I'm not changing any code and I noticed this happens w/ my SSCCE and the actual program. I'm using Netbeans, I right click the file and choose run.
    Here's the SSCCE:
    package carbuyer;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.TitledBorder;
    public class SampleApplet extends JApplet implements ActionListener {
        private JTextField jtfSellingPrice = new JTextField();
        private JButton jbtComputeCost = new JButton("Compute Cost");
    @Override
    public void init() {
            //Right align text fields
            jtfSellingPrice.setHorizontalAlignment(JTextField.RIGHT);
            //Panel p1 to hold labels and text fields
            JPanel p1 = new JPanel();
            p1.setLayout(new GridLayout(5,2));
            p1.add(new Label("Selling Price: "));
            p1.add(jtfSellingPrice);
            p1.setBorder(new TitledBorder("Enter Selling price, trade in value, down payment, APR, and loan term"));
            //Panel p2 to hold the button
            JPanel p2 = new JPanel();
            p2.setLayout(new FlowLayout(FlowLayout.RIGHT));
            p2.add(jbtComputeCost);
            //Add the components to the applet
            getContentPane().add(p1,BorderLayout.CENTER);
            getContentPane().add(p2,BorderLayout.SOUTH);
            //Register listener
            jbtComputeCost.addActionListener(this);
                    try {
                java.awt.EventQueue.invokeAndWait(new Runnable() {
                    public void run() {
                        initComponents();
            } catch (Exception ex) {
                ex.printStackTrace();
    /**Handle the ComputeCost button */
        public void actionPerformed(ActionEvent e)
        /** This method is called from within the init() method to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc="Generated Code">
        private void initComponents() {
            setLayout(new java.awt.BorderLayout());
        }// </editor-fold>
        // Variables declaration - do not modify
        // End of variables declaration
    }

    Here's my SSCCE to demonstrate the problem that occurs when you set the contentPane's layout to BorderLayout after adding components:
    import java.awt.BorderLayout;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    public class SampleSwing {
      private static void createAndShowGUI() {
        JPanel mainPanel = new JPanel();
        mainPanel.add(new JButton("Fubar"));
        JFrame frame = new JFrame("SampleSwing Application");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.getContentPane().add(mainPanel);
        // Comment and uncomment the following line to see its effect:
        //frame.getContentPane().setLayout(new BorderLayout());
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
      public static void main(String[] args) {
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
          public void run() {
            createAndShowGUI();
    }

  • Need help with Java applet, might need NetBeans URL

    I posted the below question. It was never answered, only I was told to post to the NetBeans help forum. Yet I don't see any such forum on this site. Can someone tell me where the NetBeans help forum is located (URL).
    Here is my original question:
    I have some Java source code from a book that I want to compile. The name of the file is HashTest.java. In order to compile and run this Java program I created a project in the NetBeans IDE named javaapplication16, and I created a class named HashTest. Once the project was created, I cut and pasted the below source code into my java file that was default created for HashTest.java.
    Now I can compile and build the project with no errors, but when I try and run it, I get a dialog box that says the following below (Ignore the [...])
    [..................Dialog Box......................................]
    Hash Test class wasn't found in JavaApplication16 project
    Select the main class:
    <No main classes found>
    [..................Dialog Box......................................]
    Does anyone know what the problem is here? Why won't the project run?
    // Here is the source code: *****************************************************************************************************
    import java.applet.*;
    import java.awt.*;
    import java.awt.geom.*;
    import java.awt.event.*;
    import java.util.*;
    public class HashTest extends Applet implements ItemListener
    // public static void main(String[] args) {
    // Hashtable to add tile images
    private Hashtable imageTable;
    // a Choice of the various tile images
    private Choice selections;
    // assume tiles will have the same width and height; this represents
    // both a tile's width and height
    private int imageSize;
    // filename description of our images
    private final String[] filenames = { "cement.gif", "dirt.gif", "grass.gif",
    "pebbles.gif", "stone.gif", "water.gif" };
    // initializes the Applet
    public void init()
    int n = filenames.length;
    // create a new Hashtable with n members
    imageTable = new Hashtable(n);
    // create the Choice
    selections = new Choice();
    // create a Panel to add our choice at the bottom of the window
    Panel p = new Panel();
    p.add(selections, BorderLayout.SOUTH);
    p.setBackground(Color.RED);
    // add the Choice to the applet and register the ItemListener
    setLayout(new BorderLayout());
    add(p, BorderLayout.SOUTH);
    selections.addItemListener(this);
    // allocate memory for the images and load 'em in
    for(int i = 0; i < n; i++)
    Image img = getImage(getCodeBase(), filenames);
    while(img.getWidth(this) < 0);
    // add the image to the Hashtable and the Choice
    imageTable.put(filenames[i], img);
    selections.add(filenames[i]);
    // set the imageSize field
    if(i == 0)
    imageSize = img.getWidth(this);
    } // init
    // tiles the currently selected tile image within the Applet
    public void paint(Graphics g)
    // cast the sent Graphics context to get a usable Graphics2D object
    Graphics2D g2d = (Graphics2D)g;
    // save the Applet's width and height
    int width = getSize().width;
    int height = getSize().height;
    // create an AffineTransform to place tile images
    AffineTransform at = new AffineTransform();
    // get the currently selected tile image
    Image currImage = (Image)imageTable.get(selections.getSelectedItem());
    // tile the image throughout the Applet
    int y = 0;
    while(y < height)
    int x = 0;
    while(x < width)
    at.setToTranslation(x, y);
    // draw the image
    g2d.drawImage(currImage, at, this);
    x += imageSize;
    y += imageSize;
    } // paint
    // called when the tile image Choice is changed
    public void itemStateChanged(ItemEvent e)
    // our drop box has changed-- redraw the scene
    repaint();
    } // HashTest

    BigDaddyLoveHandles wrote:
    h1. {color:red}MULTIPOST: [http://forums.sun.com/thread.jspa?threadID=5358840&messageID=10564025]{color}
    That wasn't attention-grabbing enough apparantly. Let's try it again.
    h1. {color:red}MULTIPOST: [http://forums.sun.com/thread.jspa?threadID=5358840&messageID=10564025]{color}
    h1. {color:red}MULTIPOST: [http://forums.sun.com/thread.jspa?threadID=5358840&messageID=10564025]{color}
    h1. {color:red}MULTIPOST: [http://forums.sun.com/thread.jspa?threadID=5358840&messageID=10564025]{color}
    h1. {color:red}MULTIPOST: [http://forums.sun.com/thread.jspa?threadID=5358840&messageID=10564025]{color}
    h1. {color:red}MULTIPOST: [http://forums.sun.com/thread.jspa?threadID=5358840&messageID=10564025]{color}

  • Loading applet onto card in netbeans

    Hi guys!
    I have installed Netbeans 6.7 and Connected developer 3.0.1. I have installed the cardmanager plugin for netbeans. Now I want to install an applet I have developed on my card. I have a CardMan 5321 with a NXP JCOP 31V2.2 36K card.. How do I write the applet to the card?

    JC3 is a vaporware until we have them in stores / until a reasonable number of people can access samples / until it's out of the labs. Okay, troll is fed, now the real topic.
    This line won't fit on ANY javacard currently deployed/usable in the world. JCOP is only one of them.
    The proper way to handle integers out of the short range is through an array of bytes and hand crafted arithmetic routines. This is easy, remember the high schools days. Add bytes starting from the right, propagating carry bits to the bytes at the left.
    Then your line translates to:
    private static final byte[] mylong = { (byte)0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00 };
    Use transients for intermediate calculations.
    You can also tweak this to use shorts instead of bytes, but detecting carry overflows will be trickier and this does not give any benefit, from my point of view. Storage size will be the same.
    Use (short)(a_byte&0xff) to get unsigned bytes in shorts: raw short and bytes are signed and (short)a_byte will give you 0xFF80 (or a negative short) if a_byte is 0x80 (or a negative byte), ie sign extension occurs.
    Regards
    Sebastien

  • How to start java applet with netbeans 6.1

    hey,
    I want to learn how to start java applet (with database) with netbeans.. I'm new to java...can you show me how can i start..if you have any doc about it can you send it to me..thank you..:)

    You really should be asking this NetBeans question at the NB site - these forums are for Java language topics, not NB support.
    [http://www.netbeans.org/kb/61/web/applets.html]
    Almost any NB question you have can be answered by either the NB web documentation or the NB program's Help.

  • How to run Applet using jsp in netbeans 5.5

    hi,
    I want to run an applet program using jsp and tomcat. I have created an applet class in NetBeans 5.5 and also a Jsp. In that jsp I have given the <jsp:plugin type="" code="" ......> tag. But its not warking. Can any one please tell me the correct steps to run that applet?
    Thanks

    no clue???????????

  • JavaFX Applet only works with Netbeans

    Hello Together,
    i have a Problem with my JavaFX Applet. All works fine but only if Netbeans start the Browser Applikation or Netbeans is runing in the Background. If i start the Website with the Applet without Netbeans only the JavaFX Icon will schow and nothing happens.
    But the Java Platform is loaded if i start the Applet.
    I inserted the Applet via JS like this:
    <script src="http://dl.javafx.com/1.1/dtfx.js"></script>
    <script>
        javafx(
                  archive: "Applet.jar",
                  draggable: true,
                  width: 600,
                  height: 600,
                  code: "bewertung.Main",
                  name: "Bewertung"
    </script> Sorry for my bad english.

    I forget to Post the Message from the Java Console.
    java.io.FileNotFoundException: JNLP not available: classes/bewertungfx/Bewertung_browser.jnlp
         at sun.plugin2.applet.JNLP2Manager.loadJarFiles(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Exception: java.io.FileNotFoundException: JNLP not available: classes/bewertungfx/Bewertung_browser.jnlp
    But the File classes/bewertungfx/Bewertung_browser.jnlp exists and is readable.

  • Applet programming with Netbeans?

    Well I have been wanting to make a 2D side scrolling SIMPLE game with Java, just as a way for me to get my feet wet and keep practicing programming between classes.
    I have been using this guide: http://www.gamedev.net/reference/programming/features/javagame1/
    But whenever I make a new Java Application in netbeans and try to follow along, it doesn't work.
    I don't mind using notepad and JDK, but in all my classes every program we had to make was able to be made in Netbeans. Alot of these terms like:
    public class HelloWorld extends Applet
    public void paint (Graphics g)
    g.drawString("Hello World!", 50, 25);
    I have never even heard of using g.drawString, we always used System.out.printf or println or just print... Also never extended an Applet.
    Maybe I am just not up to date enough to start this particular tutorial? I can easily get it to work using notepad, HTML, etc. I also have Java Studio Creator 2 (came with a textbook)

    Swing makes it relatively trivial to write an application which will run as either a JApplet or within a JFrame... They're just alternate "top level containers" which contain a JPanel, which contains "all the guts" of your program.
    I find JFrames more convenient to work with locally... the downside is that you have to be careful to avoid doing things (like accessing the local filesystem) which the security manager will (quite rightly) object to when it's published as an applet. Read-up on applet security restrictions before you start and you should be right.
    Alternately, the JDK ships with an appletviewer.
    Netbeans includes an applet-container, specifically to make applet development more convenient... except it would (from my google search) appear to "have a few bugs", like it uses the desktop security manager which would give the developer false positives on what you can do in an applet... and having not used it myself I'm loathe to recommend it.
    Cheers. Keith.

  • Applet called from netbeans TomcatServletExample

    How?
    I started with the netbeans Tomcat Servlet Example as a base and it works fine.
    I would like to load an applet created under the same project and placed into
    the TomcatServletExample.war or in a seperate project with a seperate jar archive.
    (I have tried both)
    I have added the TestApplet.html to the Servlet project and call it from the example index.html
    My TestApplet.html just can not find my applet code.
    The error is a
    load: class socapplets.AReflectance.class not found.
    My HTML looks something like the following, I have tried many combinations with and without the
    codebase.
    <html>
    <head>
    <meta content="text/html; charset=ISO-8859-1"
    http-equiv="content-type">
    <title>TestApplet</title>
    </head>
    <body>
    Test Applet<br>
    <br>
    <APPLET CODE="socapplets.AReflectance.class"
    archive="socApplets.jar"
         WIDTH=550 HEIGHT=450>
    </APPLET>
    </body>
    </html>
    Is there a simple way of loading an applet into an external browser under netbeans. This
    is just for development only. I hope to make the applet communicate back to one of my servlets.
    My Browser is Mozilla 1.7

    Followup to my own question.
    I finally got my applet to run by adding a jar archive containing the applet directly to
    my tomcat war archive. This is ok but not ideal. I wonder if this is a strange feature of the
    bundled Tomcat or netbeans. This maybe the wrong forum, but I do
    see others with applet class not found questions. This may help.
    Thank you.
    ~
    ~

  • Applet Won't work out of NetBeans W/Swing

    My Applet is working in NetBeans sun AppletRunner, but won't run in a browser and gives this exception:
    java.lang.NoClassDefFoundError: org/jdesktop/layout/GroupLayout$Group
         at java.lang.Class.getDeclaredConstructors0(Native Method)
         at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
         at java.lang.Class.getConstructor0(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)And my Applet extends javax.swing.JApplet, so whats wrong?

    Did you specify the jar in the archive attribute of the applet element tag?
    http://java.sun.com/docs/books/tutorial/uiswing/components/applet.html#plugin
    Of course this does not help if the class is not in the jar though. :-/ (which seems very strange)
    -Puce

  • Applet not running outside of netBeans

    I have an applet that was compiled & built within NetBeans 4.1 under jdk1.5.0_04. It runs perfectly inside of NetBeans. It doesn't run outside of NetBeans.
    I created the HTML launcher file and placed it in the same folder where the applet class file resides.
    <HTML>
    <BODY>
    <APPLET CODE=Main.class
    WIDTH=250
    HEIGHT=130>
    </APPLET>
    </BODY>
    </HTML>
    When I launch the HTML file under windows XP I get a NullPointerException.
    When I try to use appletviewer I get the following:
    Warning:Can't read AppletViewer properties file: c:\Documents and Settings\walter88\.hotjava\properties using defaults. I/O exception while reading: c:\Program (The system cannot find the file specified).
    Someone please help this 'newbie'.
    Thanks.

    Thanks for your reply. here is the applet code:
    package javaapplication4;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.text.DecimalFormat;
    public class Main extends JFrame
        implements ActionListener {
        private JButton button;
        public static void main(String[] args) {
            Main frame = new Main();
            frame.setSize(400, 300);
            frame.createGUI();
            frame.setVisible(true);
        private void createGUI() {
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            Container window = getContentPane();
            window.setLayout(new FlowLayout() );
            button = new JButton("Press me");
            window.add(button);
            button.addActionListener(this);
        public void actionPerformed(ActionEvent event) {
            DecimalFormat df1 = new DecimalFormat( "#####.0000");
            String Od, Length, Weight, Density;
         double od, length, weight, density, const_1, const_2, or, wall;
         Od = JOptionPane.showInputDialog("Enter OD of tubing (inch)");
         Length = JOptionPane.showInputDialog("Enter length (inch)");
         Weight = JOptionPane.showInputDialog("Enter weight (grams)");
         Density = JOptionPane.showInputDialog("Enter density (lbs/in3)");
         od = Double.parseDouble( Od );
         length = Double.parseDouble( Length );
         weight = Double.parseDouble( Weight );
         density = Double.parseDouble( Density );
         or = .5 * od;
         const_1 = 3.14159 * 453.59 * density * length;
         const_2 = -4 * const_1 * or;
         wall = (-const_2 - Math.sqrt(const_2 * const_2 - 4 * const_1 * weight))/(2 * const_1);
            JOptionPane.showMessageDialog(null, "Wall thickness is: " + df1.format(wall) + " inch");
    }

  • Error while test applet with jcwde simulator using netbeans

    i make applet using netbeans 6.5.. i have compile class and i get no error and results *.class but while I use netbeans service on Javacard simulator.. while I try to connect with entry aid applet i have an error.
    this is error log
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    + +
    + Cannot connect to simulator. Cause: Exception during creating JavaCardSimulatorAdapter +
    + +
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    why this error is happened ?
    thank for your attention.. :D
    By Roni
    Edited by: ronized on Apr 18, 2009 6:35 AM

    Hi,
    As per this part of the trace:
    Exception in SAP Application Integrator occured: Application URL &\#39;:///sap(ZT1KVXBWektldldTeV9QQXBXRjNaWTRBLS1OZmRvZzBRWWY2QmN0WThNUmgqdUlRLS0=)/bc/gui/sap/its/webgui&\#39; is not valid! Please check the protocol and host entries for system &\#39;sapdev&\#39;. at ...
    You can clearly see that the system object 'sapdev' is not configured correctly/at all - you are trying to launch transaction iView
    (WEBGUI) and in order to do so you should configure the 'internet transaction server' category of the system  object
    with the hostname of the ITS server.
    Generally the template is
    <System.Access.ITS.protocol>://<System.Access.ITS.hostname>/sap<ESID>/bc/gui/sap/its/webgui?\....
    So that's why you got
    Please check the protocol and host entries for system ..

  • SetForeground in Applet does not work (Netbeans under Linux)

    I'm attempting to make a Breakout version of java (if I go through with it) and the first issue that I encountered is that I can't change the color of the moving rectangle (you know, the thing you hit the ball with). I tried the code under Textpad on a Windows machine and that worked fine, but not under Netbeans in Linux using jdk 1.6.0_01.
    import java.awt.*;
    import java.applet.*;
    import java.awt.event.*;
    public class Breakout extends Applet implements MouseListener, MouseMotionListener{
         int mouse_x, mouse_y;
         Thread t;
         public void init(){
              addMouseListener(this);
              addMouseMotionListener(this);
         public void start(){
              t= new Thread();
              t.start();
         public void run(){}
         public void mouseClicked(MouseEvent me){ }
         public void mouseEntered(MouseEvent me){ }
         public void mouseExited(MouseEvent me){ }
         public void mousePressed(MouseEvent me){ }
         public void mouseReleased(MouseEvent me){ }
         public void mouseDragged(MouseEvent me){ }
         public void mouseMoved(MouseEvent me){
              mouse_x = me.getX();
              if(mouse_x>=400)
                   mouse_x=400;
              repaint();
         public void stop() {}
         public void destroy(){ }
         public void paint(Graphics g){
              setBackground(Color.black);
              setForeground(Color.white); //doesn't work              
              g.drawRoundRect(mouse_x, 600, 50, 20, 20, 20);
    }I'm wondering if it's because the Applet under Linux uses the Native l&f theme while appets under Windows uses the Windows l&f theme.
    Any thoughts would be helpful!

    setForeground(Color.white); //doesn't work
    g.drawRoundRect(mouse_x, 600, 50, 20, 20, 20);Change this to:
    g.setColor(Color.WHITE);
    g.drawRoundRect(mouse_x, 600, 50, 20, 20, 20);You can move the background setting into method init(), calling it once is enough.
    I'm wondering if it's because the Applet under Linux
    uses the Native l&f theme while appets under Windows
    uses the Windows l&f theme.You use java.awt.Applet, so you use AWT which means there's no L&F theme (as in Swing) but it's native components being responsible.

  • Using netbeans module project in applet

    Hi,
    I just wondering, is it possible to use a netbeans module project inside of an java applet project. If yes, how can i do this.
    best wishes,
    ufuk

    Hi Dorhyz,
    Please try to use suffix 1 in port number. like if your server port number is 50000 then 50001.
    https://domine:50001/web.com/file.jsp
    Refer to http://wiki.sdn.sap.com/wiki/display/EP/Convertinghttpto+https
    Hope it will helps
    Regards
    Arun Jaiswal

Maybe you are looking for

  • How to remove MacProtector

    Man alive!!! Oh My!  I can't believe I've done a really stupid thing!!!  Same thing popped up on my screen. Said I had a lot of viruses . . . . . .clicked on 'remove all'  and then . . . . .I INSTALLED the application MacProtector!   The thing has ru

  • Parachute - Sync folders over the internet

    Hi all, Over the last few weeks I've created a file synchronisation program in Java (called Parachute). The program will connect to another instance of itself running on another machine on the network (or internet), (i.e. it is both the client and th

  • How to show reasons of action based on PA?

    Experts We are in the process of implementing for different countries simultaneously. We have 10 actions which are common for all these countries. However these countries have different reasons of action for these diferent set of 10 actions. I want t

  • Outlook contact disppear

    I am using Outlook 2013 Anywhere connected with Office 365.  Each time that I add a new contact locally it get deleted after a few seconds and it shows the following error message in Sync Issues Folder: 15:21:40 Synchronizer Version 15.0.4631 15:21:4

  • Can you adjust the pitch of a track in the middle of a song in Logic Express?

    Can you adjust the pitch of a track in the middle of a song in Logic Express? So have the first  40 bars in C minor and the last 16 in D major for example? Thanks