Issue viewing Swing components

I currently am able to compile, but not view Swing components. I am running Windows Media Center Edition with Radeon X300 graphics card. Swing programs execute but I only see the border window with only grey content inside. I have 1gb of memory and have tried running very small applications with the same effect. Does Java not support my OS? Any ideas?

Some sample code follows that doesn't work for me
At odd times I can see some of the swing applications I try to run, but it isn't consistent. This makes me think it is a memory problem, but I'm not sure. The following application takes 19,040 K with 373688 K available physical memory.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class DefaultButton {
public static void main(String args[]) {
Runnable runner = new Runnable() {
public void run() {
JFrame frame = new JFrame("DefaultButton");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setLayout(new GridLayout(2, 2, 10, 10));
JButton button1 = new JButton("Text Button");
button1.setMnemonic(KeyEvent.VK_B);
frame.add(button1);
Icon warnIcon = new ImageIcon("Warn.gif");
JButton button2 = new JButton(warnIcon);
frame.add(button2);
JButton button3 = new JButton("Warning", warnIcon);
frame.add(button3);
String htmlButton = "<html><sup>HTML</sup> <sub><em>Button</em></sub><br>" +
"<font color=\"#FF0080\"><u>Multi-line</u></font>";
JButton button4 = new JButton(htmlButton);
frame.add(button4);
JRootPane rootPane = frame.getRootPane();
rootPane.setDefaultButton(button2);
frame.setSize(300, 200);
frame.setVisible(true);
EventQueue.invokeLater(runner);
}

Similar Messages

  • HT5797 produces this java update a issue with swing components?

    Hi folks
    actually my swing java programs doesnt work anymore. The swing ui doesnt start completly, some components like textbox, buttons, labels arent rendered. Also the system log contains nothing...
    Greetings
    Steffen

    Hi folks , hi Apple team
    this bugy update costs many hours to check this out and find a solution ...
    and now im read that the "great" apple distribute bugy updates with the same version 004, correct the bug in the background and do nothing to solve this problem for the affected users. Apple this was no great work. Im a developer and now im, asking me if a mac is the right developing platform
    here is what i mean:
    macsbod:soft sbode$ /usr/libexec/java_home -v 1.6 -exec java -version java version "1.6.0_51" Java(TM) SE Runtime Environment (build 1.6.0_51-b11-456-11M4508) Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01-456, mixed mode)
    macsbod:soft sbode$ /usr/libexec/java_home -v 1.6 -exec java -version java version "1.6.0_51" Java(TM) SE Runtime Environment (build 1.6.0_51-b11-457-11M4509) Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01-457, mixed mode)
    if you have the 4508 version, you have the bugy update and you must manually load and install the update with the correct java again :
    10.7
    http://support.apple.com/kb/DL1572?viewlocale=en_US&locale=en_US
    10.6
    http://support.apple.com/kb/DL1573
    Apple, why do you dont offer official over software updates a fix for this bugy update ???
    Cheers
    Steffen

  • Swing components without using applets

    hi there
    can i display swing components on the browser without using applets through jsp.
    if the answer is yes.please help me by sending a sample code.thanking u.
    -radhakrishna

    A JSP is compiled into a (server-side, obviously) servlet, which responds to Http requests by constructing a String of HTML/JavaScript etc to send back to the browser which then displays it.
    A Swing component is a piece of Java. The only way for such a component to run on the client side is to use either Applets or the new Java WebStart technology (see the JDC), which allows you to run a Java App locally from a Web Browser.
    You cannot possible use JSP to view Swing Components, without also using either of the above.

  • Help: Design Issues in Swing

    Hi Friends
    I developed an application in swings way back in 2000-01. However then there were serious issues of Memory leakage with Swings. Hence the strategy we adopted was to use a cache of Swing components rather than creating new objects everytime.
    Now again in 2004, i am back to swings.
    Now are there still issues with the swings?
    What are the other things, we need to keep in mind during the design?
    I heard that listeners create problem with the components since component get registered with the Listeners and are not able to get released.
    And there are problems of lot of internal objects being created.. Is this true.. if yes.. how do we tackle the problem??

    hi,
    I'm using swing in some programs of my own, and I've not experienced any serious problems yet.
    Some points need to be mentioned however:
    - Instantiating heavyweight components (such as JFileChooser) tends to be slow, try instantiating only one JFileChooser for your application and reuse it by just hiding/showing it.
    - Most programs instantiate all their components (visible and invisible) at startup. This slows down the startup time and the performance feeling of your program. Try using lazy-instantiation (do not initialise the component at the beginning but only initialise the component when it is called upon for the first time). Some more specific instantiation-schemes can be used, for instance for image- or sound-loading.
    Of course the splash-screen with small animations tends to ease the pain to wait for the user.
    - caching can also be used to improve performance, but here I think you should always first measure the performance of the component to be cached (using a profiler). Using a cache on a well performing object might also reduce it's performance.
    To reduce the memory-footprint of the cache, you could combine it with the lazy-instantiation and perhaps even use WeakReferences to hold this objects in order not to let the cache be a memory-bottleneck.
    This can be especially useful when using large quantities of equal objects (what also happens for String) or when using a decent amount of very memory-consuming objects such as images.
    Normally (for the remaining optimization) it is adviced to not optimize while programming, and only start to optimize for performance and memory usage when problems show up. For doing this you should use some serious profiler, instead of blindly optimizing what seems slow.
    Also try reading the book about java performance which can be found using the link below:
    http://java.sun.com/docs/books/performance/1st_edition/html/JPTOC.fm.html
    This book gives many of the advices I've given above and explains the total process of performance-tuning. Another advantage of this book is that it uses Swing as an example for it's optimizations, and that the author has cooperated in programming (parts of) Swing.
    Kind regards,
    Koen

  • Swing components not displaying correctly in JApplet

    Hello everyone,
    I have experienced some strange problems using Swing components on JApplets. Maybe I missed some documentation somewhere and someone can help me out.
    The problem is that when I add components like JButtons,
    JCheckboxes, JRadioButtons, JTextFields, JPasswordFields,
    and JComboBoxes to JApplets, when I view the applet, the
    component does not become visible until I move the mouse
    pointer over it in the case of buttons. For the JComboBox I have
    to hit the mouse key many times on the component to see the list. Has anyone experienced problems like these? Thanks.
    Keith

    check what is in ur paint(Graphic g) method. if it does nothing, remove the paint(Graphic g) method. if it has some codes, double check ur codes.

  • Rendering of Swing components

    Hi,
    As the renderer is used to be client independant, is it suitable to send back to the client a serialized view of Swing components (using the new XML serialization format) ?
    This could allow server-side management of the client's look-and-feel and total move of the business on the server.
    It might sounds weird and I'm not totally clear with myself anyway.
    I think a little "deamon" should handle the requests to the server and the demarshalling step of the server response.
    Any point of view on this ?
    (this is just a thought of an alternative use of the renderer capabilities coz todays it only sends back HTML tags)
    Ionel

    Hi,
    personally, I do not have too much experience with Swing.
    There is a project on sourceforge that implements your idea but is not based on Java Server Faces.
    It's called SwingML:
    swingml.sourceforge.net

  • How to list/access swing components?

    hi all,
    Can anyone give me a clue, how can I access or simply list swing components I have on a frame, long after I created them. E.g. I'd like to change their setEnabled() attribute at a later time, not at creation time, but I don't know how to access them.
    Does Swing/AWT/JFC provides a component hierarchy? can someone share some code on this issue?
    Thanks for any help.
    Thomas

    I guess, you are saying the use of getComponent(int n)?
    Since I'm a beginner in Swing see my short code below:
    import java.awt.BorderLayout;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JMenu;
    import javax.swing.JMenuBar;
    import javax.swing.JMenuItem;
    import javax.swing.JTextArea;
    public class EasyFrame {
        public EasyFrame() {
            super();
            startHere();
        public void startHere() {
            JFrame frame = new JFrame("SwingApplication");
            JButton button = new JButton("click here");
            JTextArea area = new JTextArea();
            frame.setSize(300, 200);
            frame.getContentPane().setLayout(new BorderLayout());
            frame.getContentPane().add(area, BorderLayout.CENTER);
            frame.getContentPane().add(button, BorderLayout.SOUTH);
            area.setText("Hello World");
            JMenuBar menuBar = new JMenuBar();
            JMenu menu = new JMenu("A Menu");
            menuBar.add(menu);
            JMenuItem menuItem = new JMenuItem("A text item");
            menu.add(menuItem);
            menu.addSeparator();
            menuItem = new JMenuItem("hello");
            menu.add(menuItem);
            JMenu subMenu = new JMenu("submenu");
            menuItem = new JMenuItem("sub1");
            subMenu.add(menuItem);
            menuItem = new JMenuItem("sub2");
            subMenu.add(menuItem);
            menu.add(subMenu);
            frame.getContentPane().add(menuBar, BorderLayout.NORTH);
            frame.show();
         public static void main(String[] args) {
         EasyFrame ef = new EasyFrame();
    }If I make a System.out.println(frame.getContentPane().getComponentCount());I get 3. But I should dig deeper (with getComponent(2)) to access JMenuBar. But this way I receive a AWT Component / not a JMenuBar Swing component to get its JMenu / and its JMenuItems. And I cannot make it cast to JMenuBar since this walk-through routine should be a universal while(isThereMoreCompenent){} procedure, I don't know when to cast to what (JMenu, JMenuItem, Button and so on).
    My problem is that how can I access the JMenuItems one by one, and change e.g. the setEnabled attribute of the "hello" menu?
    I hope you can make it clear to me.
    Please help if so.

  • How to improve the Performance of Swing Components

    Hi
    I have developed a GUI Framework with Swing components. I observed that when number of components are more, the GUI is slow. Could anybody suggest me the ways to improve the performance of Swing Components
    Thanks

    Hi There - I haven't found issues so far with the speed of the GUI building, it seems fast when compared with .NET applications
    Are you doing any database querying on form load? This can slow down the loading of the GUI, I use persistence in an application and before the GUI is shown the persistence unit logs in to the database and registers itself - it does take 2/3 seconds to register and complete whatever it does before the form builds and shows
    Also check if you are loading/using any network based files on form load, this can also slow down the building considerably as well. Apart from that it's hard to say where your issue may lie apart from removing controls and checking build speed until you find the one that's slowing it down (not a good approach though) I sometimes had to load csv files from a network drive and if the file server is slow or LAN speed isn't great this can also cause a delay, hope you find it.....

  • JDBC-ODBC Bridge, Swing Components

    This program displays information from the Access database Autos.mdb.
    Uses the JDBC-ODBC Bridge.
    Requires a DSN called Autos pointing to Auto.mdb
    I am using the swing components and can't seem to set up my combobox to pull the right data which doesn't display any of the data from the database. I am able to do it using AWT but would like a sleeker look so I am trying to convert. I have made the text bold where I am having the problem. Any insight would be greatful! I am very new to JDBC-ODBC so please go easy on me...
    import java.sql.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class JDBCApp extends Frame implements ItemListener
         //Declare database variables
         Connection conVehicle;
         Statement cmdVehicle;
         ResultSet rsVehicle;
         boolean blnSuccessfulOpen = false;
         //Declare components
         JComboBox lstManuf   = new JComboBox();
         JLabel lblModel  = new JLabel("                          ");
         JLabel lblYear        = new JLabel("                          ");
         JLabel lblCost      = new JLabel("                          ");
         JLabel lblID      = new JLabel("                              ");
         JLabel lblInstructions = new JLabel("Select Manufacturer to Display Record");
         public static void main(String args[])
              //Declare an instance of this application
              JDBCApp thisApp = new JDBCApp();
              thisApp.createInterface();
         public void createInterface()
              //Load the database and set up the frame
              loadDatabase();
              if (blnSuccessfulOpen)
                   setTitle("Display Auto's Database");
                   addWindowListener(new WindowAdapter()
                             public void windowClosing(WindowEvent event)
                                  stop();
                                  System.exit(0);
                   setLayout(new FlowLayout());
                   add(new JLabel("Manufacturer"));
                   add(lstManuf);
                   lstManuf.addItemListener(this);
                   add(lblInstructions);
                   add(new JLabel("Model"));
                   add(lblModel);
                   add(new JLabel("Year"));
                   add(lblYear);
                   add(new JLabel("Cost"));
                   add(lblCost);
                   add(new JLabel("Vehicle Identification"));
                   add(lblID);
                   setSize(300,300);
                   setVisible(true);
              else
                   stop();             //Close any open connection
                   System.exit(-1);    //Exit with error status
              public void loadDatabase()
                   try
                        //Load the MicroSoft drivers
                        Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
                   catch (ClassNotFoundException err)
                             //No drivers found
                             System.err.println("Driver did not load properly");
                   try
                        //Connect to the database
                        conVehicle = DriverManager.getConnection("jdbc:odbc:Auto");
                        //Create a ResultSet
                        cmdVehicle = conVehicle.createStatement();
                        rsVehicle = cmdVehicle.executeQuery(
                                            "Select * from Vehicle;");
                        loadNames(rsVehicle);
                        blnSuccessfulOpen = true;
                   catch(SQLException error)
                        System.err.println("Error: " + error.toString());
         public void loadNames(ResultSet rsVehicle)
              try
                   //Fill last name list box
                   while(rsVehicle.next())
                   lstManuf.addItem(rsVehicle.getString("Manufacturer"));
              catch (SQLException error)
                   System.err.println("Error in display record");
         public void itemStateChanged(ItemEvent event)
              //Display the selected record
              lblInstructions.setText("");          String strManufName = lstManuf.getText();
              try
                   Statement cmdVehicle = conVehicle.createStatement();
                   ResultSet rsVehicle = cmdVehicle.executeQuery(
                        "Select * from Vehicle where [Manufacturer] = '" + strManufName + "';");
                   DisplayRecord(rsVehicle);
              catch(SQLException error)
                   System.err.println("Error in recordset");
          public void DisplayRecord(ResultSet rsVehicle)
               try
                   //Display information
                   if(rsVehicle.next()) //If more records remain
                        lblModel.setText(rsVehicle.getString("ModelName"));
                        lblYear.setText(rsVehicle.getString("Year"));
                        lblCost.setText(rsVehicle.getString("CostValue"));
                        lblID.setText(rsVehicle.getString("VehicleID"));
                   else
                        System.err.println("No more records");
              catch (SQLException error)
                   System.err.println("Error in display record");
         public void stop()
              try
                   //Terminate the connection
                   if (conVehicle != null)
                        conVehicle.close();
              catch(SQLException error)
                   System.err.println("Unable to disconnect");
    }

    I am going to help you out but first I would like to advise you not to do this.
    Mixing JDBC and Swing (or any GUI for that matter) like this is not the preferred way to proceed. If you want to learn JDBC then command line/shell is fine. If you want to learn Swing learn Swing. When you want to use the two together learn about MVC first.
    I am advising you to do this because nobody writes code like this (mixing GUI and database and business logic all in one class). So if you want real world training MVC should be what you look at next.
    See http://en.wikipedia.org/wiki/Model-view-controller for more
    As near as I can tell your problem is mostly just because you aren't using the combo box correctly. Try
    String strManufName = lstManuf.getSelectedItem().toString();it's a bit of a hack but will work for your purposes. What you need in the eend is to use the methods JComboxBox has like getSelectedItem() or getSelectedIndex().
    See http://java.sun.com/docs/books/tutorial/uiswing/components/combobox.html for more.
    Some other comments.
    1) It's nice to see you aren't just swallowing exceptions but some of them are kind of pointless if you just continue on. Like here
    try
      //Load the MicroSoft drivers
      Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
    catch (ClassNotFoundException err)
      //No drivers found
      System.err.println("Driver did not load properly");
    }And then you continue on with the method. What for? There's no point since the driver didn't load.
    2) Please look into the use of PreparedStatements. Very good things those. You can use them in place of your Statements. They are safer but for your purposes help you by you not having to worry about the formatting of data you bind to queries. For example what happens if a manufacturer name contains a ' (single quote) ? Trouble that's what. PreparedStatements make that problem go away.
    3) Don't use SELECT *. It is always good practice to put the names of the columns you are selecting. This prevents your code from breaking if the order of the columns should change in any way.

  • Swing components core design

    does the swing components, all the J... components, designed using other swing or AWT components?
    I mean a JButton is actually a panel with an image or some thing like that?
    I would like to read about these things, does any one know where to find some reading materials on the subject it would be great.
    the tutorial of each component as far as i remember does not discus the issue.
    thanks, Adam.

    i did look at the hierarchy of the components and it didn't tell me anything newIt tells you a JButton is NOT a panel with an image on it!
    java.lang.Object
      java.awt.Component
          java.awt.Container
              javax.swing.JComponent
                  javax.swing.AbstractButton
                      javax.swing.JButtonIt also tells you a lot of the painting code is going to be in AbstractButton with customizations in JButton.

  • Problem in viewing the components on running a window using java or javaw

    hi
    whenever i run a windowed application built in swing i have to resize the window in order to view the components i added to the container of the window.
    but this does not happens when i use a JProgressBar
    please help me out with this

    Read the [url http://java.sun.com/docs/books/tutorial/uiswing/TOC.html]Swing tutorial. There are plenty of examples that work correctly.
    If you still have problems then post your [url http://www.physci.org/codes/sscce.jsp]Simple, Executable Demo Program that shows the incorrect behaviour. We are not going to sit here guessing what you may or may not be doing.

  • Do swing components work in sub-menus of popup menus??

    I want to have a JSlider as a component of a sub-menu of a pop-up menu. it shows up but acts very strangely. If I grab the slider handle and drag, nothing happens. If I click to one side of the handle, the slider makes single steps repeatedly until it catches up with the position i click on.
    On the other hand, if I add a JSlider to a top-level pop-up menu, it works just fine.
    are swing components supposed to work in sub-menus of popup menus??
    i'm running java 1.5 on Windows XP.
    Thanks, - Conal

    The music store is part of iTunes. That is why they are together on the menu. As many topics would offer the same advice for music in your library or music in the store, grouping them together makes sense in terms of reducing redundant entries.
    Sorry you found it confusing. I, too, once found some things Apple a bit different. That was about two years ago when I bought my iBook. StarDeb is another recent switcher. And I feel confident in saying this: either of us would be more than happy to help you with anything that gets "lost in translation". We both know there is a learning curve when you move from the XP world to a more fruit-based view of things

  • Persisting Swing Components

    Hello,
    I am having problems with the XmlEncoder. I have created a GUI using and MVC pattern and I am trying to Serialize my view and model in a xml format so i can reload it at a later time. However, The XmlEncorder is not writing out my CustomTables (A class that extends JTable with a DefaultConstructor and bean properties), nor is it writing out the JList swing Components. Due to the fact that it writes out my TextFields, ComboBox, and Checkboxes. I have tried to recreate my tables using the Data from my Model. However, it is not writing out List<Object> types. I have followed the Java bean convention, all my fields have "getters & setters". All of my Classes extends Serializable. Is there anything I'm missing? Those the encoder persist inner class?

    Hi,
    Thanks for the reply. I guess I was trying to take the other approach because the XmlEncoder tool is suppose to be able to persist swing components. However, I have also try to serialize the model with this tool and it is not Writing out all of my properties. I have used XStream to write the model out to xml and it works fine; so yes I can reinitialize my GUI with that. However, I am farely interested in the reason this XmlEncoder is not working. I have satisfied all of the requirements that has been define for this tool to work.

  • Swing components in applet not working in web browser

    Hi Guys,
    I've created an applet which makes use of some swing components, but unfortunately, not all of them function properly in my web browser (internet explorer or Mozilla Firefox). Its mainly the buttons; the last buttons works and displays the correct file within the broswer, but the first 5 buttons do not work...
    any help please on how I can sort this problem out?
    Heres the code for my applet:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.applet.*;
    public class MainAppWindow extends JApplet
    int gapBetweenButtons = 5;
    final JPanel displayPanel = new JPanel(new BorderLayout());
    public void init()
       //Panel for overall display in applet window.
       JPanel mainPanel = new JPanel(new BorderLayout());
       mainPanel.add(new JLabel(new ImageIcon(getClass().getResource("images/smalllogo2.gif"))),BorderLayout.NORTH);
       //sub mainPanel which holds all mainPanels together.
       JPanel holdingPanel = new JPanel(new BorderLayout());
       //Panel for displaying all slide show and applications in.
       displayPanel.setBackground(Color.white);
       displayPanel.add(new JLabel(new ImageIcon(getClass().getResource("images/IntroPage.jpg"))),BorderLayout.CENTER);
       displayPanel.setPreferredSize(new Dimension(590,400));
       JPanel buttonPanel = new JPanel(new GridLayout(6,1,0,gapBetweenButtons));
       buttonPanel.setBackground(Color.white);
       JButton button1 = new JButton("User guide");
       button1.addActionListener(
         new ActionListener() {
              public void actionPerformed(ActionEvent e)
                   if(displayPanel.getComponents().length > 0)displayPanel.removeAll(); // If there are any components in the mainPanel, remove them and then add label
                   displayPanel.setBackground(Color.white);
                   displayPanel.add(new JLabel(new ImageIcon("images/UserGuide.jpg")));
                   displayPanel.revalidate(); // Validates displayPanel to allow changes to occur onto it, allowing to add different number images/applicaions to it.
       JButton button2 = new JButton("What is a Stack?");
       button2.addActionListener(
       new ActionListener() {
               public void actionPerformed(ActionEvent e)
                   if(displayPanel.getComponents().length > 0)displayPanel.removeAll();
                   displayPanel.setBackground(Color.white);
                   displayPanel.add(new JLabel(new ImageIcon("images/WhatIsAStack.jpg")));
                   displayPanel.revalidate();
       JButton button3 = new JButton("STACK(ADT)");
       button3.addActionListener(
       new ActionListener() {
             public void actionPerformed(ActionEvent e)
                   if(displayPanel.getComponents().length > 0)displayPanel.removeAll();
                   displayPanel.setBackground(Color.white);
                   displayPanel.add(new JLabel(new ImageIcon("images/StackADT.jpg")));
                   displayPanel.revalidate();
       JButton button4 = new JButton("Stacks in the Real World");
       button4.addActionListener(
       new ActionListener() {
             public void actionPerformed(ActionEvent e)
                   if(displayPanel.getComponents().length > 0)displayPanel.removeAll();
                   displayPanel.setBackground(Color.white);
                   displayPanel.add(new JLabel(new ImageIcon("images/StacksInTheRealWorld.jpg")));
                   displayPanel.revalidate();
       JButton button5 = new JButton("DEMONSTRATION");
       button5.addActionListener(
       new ActionListener() {
             public void actionPerformed(ActionEvent e)
                 if(displayPanel.getComponents().length > 0)displayPanel.removeAll();
                 Demonstration app = new Demonstration();
                 JPanel appPanel = app.createComponents();//gets the created components from Demonstration application.
                 appPanel.setBackground(Color.pink);
               displayPanel.add(appPanel);
               displayPanel.revalidate();
       JButton button6 = new JButton("Towers Of Hanoi");
       button6.addActionListener(
       new ActionListener() {
             public void actionPerformed(ActionEvent e)
                     if(displayPanel.getComponents().length > 0)displayPanel.removeAll();
                     TowerOfHanoi app = new TowerOfHanoi();
                     JPanel appPanel = app.createComponents();//gets the created components from Towers of Hanoi
                     JPanel mainPanel = new JPanel();//panel used to centralise the application in center
                     mainPanel.add(appPanel);
                     mainPanel.setBackground(Color.pink); //sets mainPanel's background color for 'Towers Of Hanoi'
                     displayPanel.add(mainPanel);
                     displayPanel.revalidate();
       //adding buttons to the buttonPanel.
       buttonPanel.add(button1);
       buttonPanel.add(button2);
       buttonPanel.add(button3);
       buttonPanel.add(button4);
       buttonPanel.add(button5);
       buttonPanel.add(button6);
       JPanel p = new JPanel(); // Used so that the buttons maintain their default shape
       p.setBackground(Color.white);
       p.add(buttonPanel);
       holdingPanel.add(p,BorderLayout.WEST);
       holdingPanel.add(displayPanel,BorderLayout.CENTER);
       //Positioning of holdingPanel in mainPanel.
       mainPanel.add(holdingPanel,BorderLayout.CENTER);
       //indent mainPanel so that its not touching the applet window frame.
       mainPanel.setBorder(BorderFactory.createEmptyBorder(10,20,10,20));
       mainPanel.setBackground(Color.white);
       mainPanel.setPreferredSize(new Dimension(850,600)); //size of applet window
       mainPanel.setOpaque(false); // Needed for Applet
       this.setContentPane(mainPanel);
    }

    Thanks for the response. I don't quite understand what you're talking about though. I have, in my humble knowledge, done nothing with packages. I have put the applet class (WiaRekenToolActiz.class is the applet class) in the jar file wia_actiz_archive.jar. From what I read on the tutorial, java looks for the applet class in all the jar files specified. Since I put my CODEBASE as the main url, I thought it baiscally didn't matter where you out the html file.
    I shall include the complete html page complete with applet tag to perhaps illuminate a bit more what I mean...
    <html>
    <head>
    <title>Wia Rekenmodule hello!</title>
    </head>
    <body bgcolor="#C0C0C0">
    <applet
    CODEBASE= "http://www.creativemathsolutions.nl/test"
    ARCHIVE= "Actiz/wia_actiz_archive.jar, Generic/wia_archive.jar"
    CODE="WiaRekenToolActiz.class" 
    WIDTH=915 HEIGHT=555
    >
    <PARAM NAME = naam VALUE = "Piet Janssen">
    <PARAM NAME = gebdag VALUE = "01">
    <PARAM NAME = gebmaand VALUE = "06">
    <PARAM NAME = gebjaar VALUE = "1970">
    <PARAM NAME = geslacht VALUE = "man">
    <PARAM NAME = dienstjaren VALUE = "10">
    <PARAM NAME = salaris VALUE = "56500">
    <PARAM NAME = deeltijdpercentage VALUE = "100">
    <PARAM NAME = accountnaam VALUE = "Zorginstelling 'De Zonnebloem'">
    </applet>
    </body>
    </html>

  • I can't use swing components in my applets

    When I write an applet without any swing components, my browser never has any trouble finding the classes it needs, whether they're classes I've written or classes that came with Java. However, when I try to use swing components it cannot find them, because it is looking in the wrong place:
    On my computer I have a directory called C:\Java, into which I installed my Java Development Kit (so Sun's classes are stored in the default location within that directory, wherever that is), and I store my classes in C:\Java\Files\[path depends on package]. My browser gives an error message along the lines of "Cannot find class JFrame at C:\Java\Files\javax\swing\JFrame.class"; it shouldn't be looking for this non-existent directory, it should find the swing components where it finds, for example, the Applet class and the Graphics class.
    Is there any way I can set the classpath on my browser? Are the swing components stored separately from other classes (I'm using the J2SE v1.3)?
    Thanks in advance.

    Without having complete information, it appears that you are running your applets using the browser's VM. Further, I assume you are using either IE or Netscape Navigator pre-v6. In that case, your browser only supports Java 1.1, and Swing was implemented in Java 1.2. You need to use the Java plug-in in order to use the Swing classes (see the Plug-in forum for more information), or else download the Swing classes from Sun and include them in your CLASSPATH.
    HTH,
    Carl Rapson

Maybe you are looking for

  • Strange Error in OBIEE 11g

    Hi Friends, Currently, i was working in mapping feature in obiee 11g. For that i have added <li>Necessary <spatial tags> in instanceconfig.xml file. <li>Created a new datasource in the mapviewer and brought it to the online. <li> After that i went in

  • Macbook pro retina display 15inch baseline cheap price

    Im planning to buy the new macbook pro retina 15 baseline model(late 2013). So there is this seller selling me at 5700 (ringgit malaysia). He told me that it is in a mint condition, warranty supported world wide, and he able to do COD. Can it be trus

  • Adobe flash player and adobe shockwave

    both of them are not updating for me and im getting irritated about it

  • My Apple TV buffers TV content but is fine with Movies

    I can easily watch a movie that I have purchased from the Apple TV with absolutely no buffering, but every time I try and watch a television show that I have purchased from the Apple TV it buffers in a way that I can't bear to watch it. This is clear

  • User Exit for field  resb-wempf in MB21

    Hello Guru's,         I wish to put personal no. in this field resb-wempf for only a single material code.I used this Enhancement MBCF0002 and inserted my code also but while doing MB21 it is not stopping here please guide how to move ahead. Thanks i