Multiple applets problem

Hi,
I have applet, which operates some device. It's fine as far as I want to open second applet (in fact the same applet but in new window). The problem is with Internet Explorer, because it uses the first applet window to open the second applet. So in fact it thinks that the first window is same as the second one which I want to open, so simply reloads the content of the window and the first one's content disappears. How can I open that second one in new "applet window"?
In Firefox it is OK.
Thanks
A. J.

Hi,
Did you find something to solve your problem because I have exactly the same.
Tony

Similar Messages

  • How to Debug multiple Applets in a IDE

    Hi,
    I am relatively new to Java. At work, I have a client-server style application where applets are deployed to the clients in an html page.
    Background:*
    The sequence is something like this:
    - Client goes to the relevant url
    - The returned html page has an embedded login applet
    - Upon successful login, an html page is returned that has two embedded applets
    - On the client side, navigation buttons within the applets take them to other applets
    On the server there is an application running that listens to the relevant socket (that the client sends data to) and sends out appropriate responses and data.
    Question:*
    How do i setup this system in any IDE (any IDE is ok with me) so that i can do the following:
    - Step through and debug the applets (appletviewer doesnt work because it seems to work with independent applets only. In my case, all the applets have relationships among them. eg. unless the login applet successfully completes, the other applets cannot work... etc)
    - Visually view / edit existing applets UI (something like a WYSIWYG tool)
    Thank you so much.
    schinni

    Hi,
    I am actually, working in an applet too, and I also need to debug it. With Eclipse you will easily get it, just click with Right button on the project�s name and choose: Debug As-> Java Applet. You can arrive also by: Debug As-> Open Debug Dialog. At the end you will have a window where you will be able to add the applet parameters in the Parameters tab. Finally you only have to set breakpoint (double click in the left side of any code line) and with F5, F6 and F7 you will get the absolute control. I don't think you've problems even you run multiple applets.
    Hope it helps you (sorry for my poor English).

  • Reinitialization of static data by multiple applets

    Hi,
    I have a problem with initialization of shared static data by multiple applets. I have three applets running inside of different HTML frames in a multi-frame HTML framework. Applets are loaded as JAR files. In addition, every applet has one or two 3rd party JARs listed in the APPLET tag. Applets share the same codebase and run inside the same JVM.
    I use static data to perform the inter-applet communication. This is simply a static list of applet references that is being maintained in the base applet class (all applet classes are inherited from that class). The problem is that when applets get constructed, the static data in the base class sometimes gets reinitialized multiple times. As I understand, the static data should be initialized just once on initial load of the base applet class (applets have the same codebase).
    This problem seems to be caused by the race condition (applets initialize on different threads launched by the browser). Under some circumstances (I change the number and order of JARs, etc.) everything works fine. I can reproduce this problem on both Explorer 5.x and Netscape 4.7 (did not try others). I run applets using native browser's JVM.
    Has anybody had such problem before? Is it caused by the large number of JARs ? Is there any way to guarantee that static data will be initialized once in the multi-applet environment ?
    Thanks,
    hparfen

    Hi,
    Did you find something to solve your problem because I have exactly the same.
    Tony

  • Multiple Inheritance problem persists in Interfaces

    Hi,
    I tentatively made a program and found that multiple inheritance problem of C++ persists even with interfaces. Although this is definetely a special case but I want to know what is this problem known as( i know that this is perhaps known as diamond problem in C++). And is there a way out of this thing.
    interface one
         int i=10;
    interface two
         int i=20;
    interface z extends one,two
    public class xyz implements z
         public static void main(String [] a)
         System.out.println(i);
    }O/P
    D:\Education\Java\JavaStudyRoom\Applets>javac xyz.java
    xyz.java:16: reference to i is ambiguous, both variable i in one and variable i
    in two match
    System.out.println(i);
    *^*
    *1 error*
    Thanks for replying

    suvojit168 wrote:
    I tentatively made a program and found that multiple inheritance problem of C++ persists even with interfaces. Although this is definetely a special case but I want to know what is this problem known as( i know that this is perhaps known as diamond problem in C++). And is there a way out of this thing. This is not the so called diamond inheritance problem. What you have here is an ordinary name clash. And as has been noted you can resolve it by qualifying which constant you're referring to, like
    System.out.println(one.i);
    For the diamond inheritance problem to apply both the one and the two interfaces would need to inherit a common ancestor (that's how the diamond is formed). Furthermore the common anscestor would need to carry implementation which would then be inherited two ways, once via one and once via two. This is the diamond inheritance problem Java is avoiding by allowing single inheritance of implementation only.
    P.S. My previous post was posted my mistake.

  • Forms 11g: Multiple applets same oracle session??

    Hi,
    I am developing an AJAX environment that integrates different technologies, including Forms 11g.
    I need to open multiple forms within the environment, I'm calling to various forms and works fine.
    But the problem is that it opens a database session for each applet that is executed.
    Is it possible to have multiple applets with a unique session of Oracle?
    Did you configure the Forms Service? With the Parameters to environment?
    Thanks in advanced

    That's a feature that would make the whole Forms Community happy. Not me, and most others B-)
    http://talk2gerd.blogspot.com/2011/08/result-of-2011-oracle-forms-poll-part-7.html
    My most wanted would be the same as #1 on that list: reintroduction Client/Server.
    Anyway, as for the OP:
    I am developing an AJAX environment that integrates different technologies, including Forms 11g.Are you looking for something like this?
    http://www.oracle.com/technetwork/articles/adf/wilfred-adf-forms-099635.html

  • Loading multiple applets

    Dear users,
    I am using Gemplus Cards. I am trying to
    load multiple applets with same package ID but
    not able to load. Please can any body
    let me know a set of clean steps or any source of Information
    Docs/Tutorials etc..
    Thanks
    Aslam

    hi!
    I was facing the same problem as you and had it fixed recently. You must change the code from your cardconvert batch file accordingly.
    Keeping in mind the command for the creation of a jca file should remain like this -->
    converter <options> package_name package_aid major_version.minor_version
    So we just change the <options> code to accomodate the additional applets. All else remains unchanged. Hope it helps =)

  • Plugin reloading too slow of multiple applets per page

    Hi,
    I want to share a problem with this community and try to shed some light on this.
    We all know that an applet loads slow when the JVM loads for the first time or when an applets JAR gets loaded. Fine and not the problem here.
    However, applets load too slow when loaded again during the same browser session. Why is this important? Well, in an AJAX-like intranet application you may use multiple applets per page which are loaded again and again as you navigate. The applets could enrich the user experience much the way AJAX does -- if only the applets would not slow down loading of pages.
    For example: we have pages with about 10 applets which take about 4 seconds to reload, or 400 ms per applet. This is disappointingly slow because there is no technical excuse for this -- everything is up and running on the Java side and Flash prooves that loading ActiveX can be fast, too. Moreover, it became slower and slower from 1.1 to 1.5.
    Nobody at Sun or elsewhere seems to care about this. And therefore, the plugin has now became problematic in Ajax-like intranet scenarios.
    This is a pitty and we would very much welcome any kind of activity to improve this.
    Anybody knows why this is slow and what is planned to improve this?

    There is one known optimization (which may be useful for the readers of this topic):
    One may try to keep at least ONE applet with the given EXACT (IDENTICAL archive string) classpath active, e.g., in a frame. This keeps the classloader referenced all the time and avoids reconstruction of the class loader.
    However, we already apply this technique and the question is how to get reloading of applets with a ready classloader as fast as FLASH...

  • Web page applets problems

    little problem here.
    i'm trying to design a web site that uses multiple applets to prompt the user for information than uses it to create another applet. The problem is i don't know how to write groups of applets in a package. I'm looking for advice on createing and destroying applets at a web site. I can't seem to create an applet that works through multiple classes. Could someone show me the structure of the "applet code" near the top? I think it might be different if i'm trying to create and destroy applets from multiple classes. If anyone has any suggestions on how to do this i'd really appreciate some advice.

    post some code

  • Handling multiple applets inside applet window

    Hi all,
    Does anyone know of a tutorial for handling multiple applets inside an applet window ?? Any suggestions would be greatly appreciated.
    Regards,

    Hello vhhuynh,
    Did you ever get a solution to your question: 'tutorial for handling multiple applets inside an applet window'?
    I have the same situation...
    thanks, msp@duke

  • SP10 - multiple approver problem with CUP

    We have SP10 (patch 1) in our development system and cannot move forward to production because of a real show stopper.  I have currently reported this to SAP thru an OSS message (and it is in development) but would like to know if anyone else is having this issue with SP10.  (this happened even before applying patch 1)
    We have multiple approvers when creating NEW users or CHANGING users in CUP.  We have it configured to allow just one of the approvers to approve before going on to the next stage.  Since we put in SP10, CUP is requiring ALL approvers to approve the request before going on to the next stage.  We get the following message when one of the approvers approve the request:  Request no: 5020. is approved, pending for other Approvers. 
    I've seen this reported for UAR and SOD but not for CUP.  In fact, there is a fix for UAR in Patch 1 of SP10.  I applied this patch but it hasn't fixed the CUP issue.  I also don't have the issue when rejecting a CUP request, or when approving it through the configuration --> Request --> Administration screen (what I consider the Back-door since only security administrators get the configuration area).
    Thanks for your input.
    Peggy

    Christian,
    I totally agree with you.
    The good news is.... We installed SP11.1 and the multiple approver problem is fixed. 
    We have decided to leave our production system at SP8 until this system settles down a bit.  Of course, this means we can't use many of the new fixes and features (such as UAR).  We use our sandbox system to apply new support packs and do very rigorous testing.  And our DEV system is at SP8 too.
    Good Luck.
    Peggy

  • L430 multiple driver problems (ultranav and others)

    Hello,
    I have multiple driver problems with my newly purchased L430.
    1) After hibernate the UltraNav driver randomly stops working. This means that the settings are grayed out and my old settings aren't applied. Sometimes the mouse pad and track ball also stop working after hibernate.
    2) The hardware mute button and hibernate don't like each other as well. After resuming from hibernate with the mute button on the sound doesn't work anymore. Rebooting only helps if you have disabled the mute before rebooting.
    3) The intel usb 3.0 driver can't be installed unless you want a lot of bluescreens.
    I do have the newest drivers and BIOS (2.54).

    It's ok my friend,  I just hope I will be able to help.
    Now to the problem. The thing that worries me the most and the reason I asked you to contact a Lenovo Repair Center, is the blue screens with the Intel Usb 3.0 installation. If the driver is correct this should not happen and most of the times it signifies a pure hardware problem, not a software one. Really, it just should not happen, period!
    So please, before anything else, download and boot with a Linux Live cd, any distro you like (e.g. Linux Mint, Fedora, etc). Better choose a 64bit version. It's one way of determining if you're facing a hardware problem with the usb 3.0 ports.
    The information you give is very useful and more or less complete, but I would like to also know the model of your SSDs, both the 2.5'' and msata.
    Meanwhile, you can check either with the Linux Live cd or with Memtest86+ your ram. This does not seem to be a memory problem but it would be nice if we could exclude it from the suspects list. Many - if not most - of these problems are multifactorial and we cannot leave anything to chance..
    Cheers!
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"!
    This will help the rest of the Community with similar issues identify the verified solution and benefit from it.

  • Package with multiple applets

    Hi
    I want to install 2 applets on real java card. They both are in the same package and cna use each other.
    How can i do this on JCOP ?
    and what if they are on difference packages and what if i am using some other lib as well ? do i need to install that lib too if yes then how ?
    BR
    Umer

    If your packages and applets are in one JCOP Java Card project, this should be handled for you. You can have multiple applets in a package, you can have multiple instances of a single applet, and you can have multiple packages with multiple applets as well as library packages.
    If you want to access an applet from another applet in the same package, it is like referencing any other class instance. If they are in different packages you need to use shareable objects. This is because of the applet firewall.
    Cheers
    Shane

  • InitialContext - Applet Problem

    Hi,
    When i try to get InitialContext from Applet ( running from appletviewer),
    i'm hitting this error. Please help me to solve this problem
    Exactly this line gives the error
    InitialContext ic = new InitalContext ( hEnv )
    Error:
    javax.naming.NoInitialContextException: Cannot Instantiate class:
    weblogic.jndi.WLInitialContextFactory
    -regards
    Abdul Malik

    you can use applet to pull data periodically from the servlet.
    mj
    "Anthony A." wrote:
    What if you want to perform some type of 'realtime' push from the server?
    Anthony
    "minjiang" <[email protected]> wrote in message
    news:[email protected]...
    why do you have to call your ejbs in applet directly? Why not use aservlet in
    between?
    The overhead of downloading so many so big jar files to the client machinewill
    kill/time out any broswer http session.
    mj
    Abdul Malik wrote:
    Dear Friends,
    After 5 days of struggle, somehow i was managed to access the EJB from
    Applet. But very slow coz of Big Jar files ( can make it bit small by
    identitfying required classes ). I dont know this is correct approach
    or
    not, but works ( damn slow )
    What i did was
    1) Installed the Latest Plugin 1.3.1
    2) Downloaded HTMLConverter tool from java.sun.com and converted my
    html file to use plugin.
    3) inlcuded few jar files in archive tag.
    The files i added in archive tag is
    1) myapplet.jar ( applet classes )
    2) weblogicaux.jar ( !!!!!!!!!!!! quite big jar file )
    3) weblogicclass.jar ( jarred all the classes from classes\weblogicfolder
    (!!!!!!!!!! so big jar file !!!!!! )
    4) myejb.jar ( suppose to work with home and remote class, but notworking
    ( looking for container generated files). so i added my EJB.jar file.dont
    know why ?????????? )
    then it works.
    well, i am not happy with this kind of approach. if any body haveefficient
    one, please kindly post it.
    Note: i tried in 1.2.2 plugin ( works )
    Environment: Windows 2000 / Windows 98, Weblogic 5.1 Service pack 7
    -regards
    Abdul Malik
    "Daniel Hoppe" <[email protected]> wrote in message
    news:[email protected]...
    Anthony,
    why should he place j2ee.jar in the applet classpath? Shouldn't be there
    actually. Your problem seems to be related to a class which is not
    serializable.
    Daniel
    -----Ursprüngliche Nachricht-----
    Von: Anthony A. [mailto:[email protected]]
    Bereitgestellt: Freitag, 22. Juni 2001 18:10
    Bereitgestellt in: jndi
    Unterhaltung: InitialContext - Applet Problem
    Betreff: Re: InitialContext - Applet Problem
    As a test, try to place the j2ee.jar and weblogic.jar in your
    <archive tag>.
    I have this code in my applet's init() method and it fails
    due to a JMS
    Exception.
    I'm using BEA's web server, jndi server, and app server on
    the same box as
    the client.
    Thanks,
    Anthony
    code:
    Hashtable ht = new Hashtable();
    ht.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    ht.put(Context.PROVIDER_URL, "t3://anthony01:7001");
    System.out.println("creating context");
    InitialContext ctx = new InitialContext(ht);
    error:
    JMSException: weblogic.jms.common.JMSException:
    java.rmi.MarshalException:
    failed to marshal public abstract weblogic.jms.client.JMSConnection
    weblogic.jms.frontend.FEConnectionFactoryRemote.createConnecti
    on(weblogic.rj
    vm.JVMID,weblogic.jms.client.JMSCallbackRemote) throws
    javax.jms.JMSException,java.rmi.RemoteException; nested exception is:
    java.io.NotSerializableException: weblogic.jms.client.JMSCallback

  • Web Applet Problem OnDemandRdrtLogin Iframe

    Hi,
    we have multiple Web Applets attached to one object.
    The Administrator has no problem. We see all the Web Applet with the correct results.
    But if we login into the system with the standard user the first time we see the following link in each web applet.
    https://secure-ausomxdsa.crmondemand.com/OnDemand/user/analytics/saw.dll?OnDemandRdrtLogin
    After refreshing the window it does work normal and the correct web applets are shown.
    We are using iframes in the web applets.
    Has someone a solution or workaround for this issue. Did not found anything about the OnDemandRdrtLogin.
    Seems like the user hast o login in to the reporting the first time. I am a bit confused that it works with Admin user and with the standarduser it does not work.
    Kind Regards,

    Well I'm sure it must be something I'm doing, but what?
    I'm able to load another jnilib using a wrapper jar with no problem. I don't have the source to this jar and jnilib so I don't know how it is being done.
    I've created a simple jnilib and wrapper pair using the apple's Xcode template, but get the following error.
    Here is the stack trace:
    java.lang.ExceptionInInitializerError
         at CaMIDIappletTest.init(CaMIDIappletTest.java:86)
         at sun.applet.AppletPanel.run(AppletPanel.java:378)
         at jep.AppletFramePanel.run(AppletFramePanel.java:176)
         at java.lang.Thread.run(Thread.java:613)
    Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission loadLibrary.caMIDI)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
         at java.security.AccessController.checkPermission(AccessController.java:427)
         at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
         at java.lang.SecurityManager.checkLink(SecurityManager.java:818)
         at java.lang.Runtime.loadLibrary0(Runtime.java:816)
         at java.lang.System.loadLibrary(System.java:992)
         at JNIWrapper.<clinit>(JNIWrapper.java:14)
    So, why can my applet work with one wrapper jar and jnilib pair, and not my pair?

  • New to Applets: Problems wiht writing to files and with scroll panes.

    Hi, I've recently graduated from university and so I have limited experience in java programming and I'm having some trouble with JApplets (this is the first time I've made one). I'm trying to make a simple program that will allow users to pick one of a few background images from a list (a list of jpanels within a scroll pane) then at the click of a button will output a CSS with the background tag set to the image location. This is for use on a microsoft sharepoint site where each user has a My-Sit area which I want to be customizable.
    So far I've been creating this program as an application rather than a JApplet and just having another class that extends the JApplet Class which then displays the JFrame from the GUI Class. This initially didnt work because I was trying to add a window to a container so I kept programming it as an application until I got it working before trying to convert it to a JApplet. I solved the previous problem by changing my GUI class to extend JPanel instead of JFrame and it now displays correctly but with a coupe of issues.
    Firstly the applet will not create/write to the CSS file. I read that applets couldnt read/write to the users file system but they could to their own. The file I wish to write to is kept on the same machine as the applet so I'm not sure why this isn't working.
    Secondly the scroll panel is no longer working properly. This worked fine when I was still running the program as an application when the GUI still extended JFrame instead of JPanel (incidentally the program no longer runs as an application in this state) but now the scroll bar does not appear. This is a problem since I want the applet to remain the same size on the page even if I decide to add more backgrounds to the list. I tried setting the applet height/width to smaller values in the html file to see if the scroll bar would appear if the area was smaller than the GUI should be, but this just meant the bottom off the applet was cut off.
    Could anyone offer any suggestion as to why these thigns arnt working and how to fix them? If necessary I can post my source code here. Thanks in advance.

    Ok, well my program is made up of 4 classes, I hope this isnt too much to be posting. If any explaination is needed then I'll post that next. Theres lots of print lines scattered aroudn due to me trying to fix this and theres some stuff commented out from when the program used to be an application isntead of an applet.
    GUI Class, this was the main class until I made a JApplet Class
    public class AppletGUI extends JPanel{
        *GUI Components*
        //JFrames
        JFrame mainGUIFrame = new JFrame();
        JFrame changeBackgroundFrame = new JFrame();
        //JPanels (Sub-panels are indented)
        JPanel changeBackgroundJP = new JPanel(new BorderLayout());
            JPanel changeBackgroundBottomJP = new JPanel(new GridLayout(1,2));
        JPanel backgroundJP = new JPanel(new GridLayout(1,2));
        JPanel selectBackground = new JPanel(new GridLayout(1,2));
        //Jbuttons
        JButton changeBackgroundJB = new JButton("Change Background");
        JButton defaultStyleJB = new JButton("Reset Style");
        //JLabels
        JLabel changeBackgroundJL = new JLabel("Choose a Background from the Menu");
        JLabel backgroundJL = new JLabel();
        //JScrollPane
        JScrollPane backgroundList = new JScrollPane();
            JPanel backgroundListPanel = new JPanel(new GridLayout());
        //Action Listeners
        ButtonListener bttnLstnr = new ButtonListener();
        //Controllers
        CSSGenerator cssGenerator = new CSSGenerator();
        Backgrounds backgroundsController = new Backgrounds();
        backgroundMouseListener bgMouseListener = new backgroundMouseListener();
        //Flags
        Component selectedComponent = null;
        *Colour Changer*
        //this method is used to change the colour of a selected JP
        //selected JPs have their background darkered and when a
        //different JP is selected the previously seleced JP has its
        //colour changed back to it's original.
        public void changeColour(JPanel theJPanel, boolean isDarker){
        //set selected JP to a different colour
        Color tempColor = theJPanel.getBackground();
            if(isDarker){
                tempColor = tempColor.darker();
            else{
                tempColor = tempColor.brighter();
            theJPanel.setBackground(tempColor);
         //also find any sub-JPs and change their colour to match
         int j = theJPanel.getComponents().length;
         for(int i = 0; i < j; i++){
                String componentType = theJPanel.getComponent(i).getClass().getSimpleName();
                if(componentType.equals("JPanel")){
                    theJPanel.getComponent(i).setBackground(tempColor);
        *Populating the GUI*
        //backgroundList.add();
        //Populating the Backgrounds List
        *Set Component Size Method*
        public void setComponentSize(Component component, int width, int height){
        Dimension tempSize = new Dimension(width, height);
        component.setSize(tempSize);
        component.setMinimumSize(tempSize);
        component.setPreferredSize(tempSize);
        component.setMaximumSize(tempSize);     
        *Constructor*
        public AppletGUI() {
            //REMOVED CODE
            //AppletGUI.setDefaultLookAndFeelDecorated(true);
            //Component Sizes
            //setComponentSize
            //Adding Action Listeners to Components
            System.out.println("adding actions listeners to components");
            changeBackgroundJB.addActionListener(bttnLstnr);
            defaultStyleJB.addActionListener(bttnLstnr);
            //Populating the Change Background Menu
            System.out.println("Populating the window");
            backgroundsController.populateBackgroundsData();
            backgroundsController.populateBackgroundsList();
            //loops to add background panels to the JSP
            ArrayList<JPanel> tempBackgroundsList = new ArrayList<JPanel>();
            JPanel tempBGJP = new JPanel();
            tempBackgroundsList = backgroundsController.getBackgroundsList();
            int j = tempBackgroundsList.size();
            JPanel backgroundListPanel = new JPanel(new GridLayout(j,1));
            for(int i = 0; i < j; i++){
                tempBGJP = tempBackgroundsList.get(i);
                System.out.println("Adding to the JSP: " + tempBGJP.getName());
                //Add Mouse Listener
                tempBGJP.addMouseListener(bgMouseListener);
                backgroundListPanel.add(tempBGJP, i);
            //set viewpoing
            backgroundList.setViewportView(backgroundListPanel);
            /*TESTING
            System.out.println("\n\n TESTING!\n Printing Content of SCROLL PANE \n");
            j = tempBackgroundsList.size();
            for(int i = 0; i < j; i++){
                System.out.println(backgroundList.getComponent(i).getName());
            changeBackgroundJP.add(changeBackgroundJL, BorderLayout.NORTH);
            changeBackgroundJP.add(backgroundList, BorderLayout.CENTER);
            //changeBackgroundJP.add(tempBGJP, BorderLayout.CENTER);
            changeBackgroundJP.add(changeBackgroundBottomJP, BorderLayout.SOUTH);
            changeBackgroundBottomJP.add(changeBackgroundJB);
            changeBackgroundBottomJP.add(defaultStyleJB);
            System.out.println("Finsihed populating");
            //REMOVED CODE
            //adding the Background Menu to the GUI and settign the GUI options
            //AppletGUI.setDefaultLookAndFeelDecorated(true);
            //this.setResizable(true);
            //this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            this.setLocation(500,500);
            this.setSize(400,300);
            this.add(changeBackgroundJP);
        //REMOVED CODE
         *Main Method*
        public static void main(String[] args){
           System.out.println("Creating GUI");
           AppletGUI theGUI = new AppletGUI();
           theGUI.setVisible(true);
           System.out.println("GUI Displayed");
         *Button Listener Inner Class*
        public class ButtonListener implements ActionListener{
            //check which button is clicked
            public void actionPerformed(ActionEvent event) {
                AbstractButton theButton = (AbstractButton)event.getSource();
                //Default Style Button
                if(theButton == defaultStyleJB){
                    System.out.println("Default Style Button Clicked!");
                //Change Background Button
                if(theButton == changeBackgroundJB){
                    System.out.println("Change Background Button Clicked!");
                    String backgroundURL = cssGenerator.getBackground();
                    if(backgroundURL != ""){
                        cssGenerator.setBackgroundChanged(true);
                        cssGenerator.setBackground(backgroundURL);
                        cssGenerator.outputCSSFile();
                        System.out.println("Backgroudn Changed, CSS File Written");
                    else{
                        System.out.println("No Background Selected");
         *Mouse Listener Inner Class*
        public class backgroundMouseListener implements MouseListener{
            public void mouseClicked(MouseEvent e){
                //get component
                JPanel tempBackgroundJP = new JPanel();
                tempBackgroundJP = (JPanel)e.getComponent();
                System.out.println("Background Panel Clicked");
                //change component colour
                if(selectedComponent == null){
                    selectedComponent = tempBackgroundJP;
                else{
                    changeColour((JPanel)selectedComponent, false);
                    selectedComponent = tempBackgroundJP;
                changeColour((JPanel)selectedComponent, true);
                //set background URL
                cssGenerator.setBackground(tempBackgroundJP.getName());
            public void mousePressed(MouseEvent e){
            public void mouseReleased(MouseEvent e){
            public void mouseEntered(MouseEvent e){
            public void mouseExited(MouseEvent e){
    }JApplet Class, this is what I plugged the GUI into after I made the change from Application to JApplet.
    public class AppletTest extends JApplet{
        public void init() { 
            System.out.println("Creating GUI");
            AppletGUI theGUI = new AppletGUI();
            theGUI.setVisible(true);
            Container content = getContentPane();
            content.setBackground(Color.white);
            content.setLayout(new FlowLayout());
            content.add(theGUI);
            AppletGUI theGUI = new AppletGUI();
            theGUI.setVisible(true);
            setContentPane(theGUI);
            System.out.println("GUI Displayed");
        public static void main(String[] args){
            AppletTest at = new AppletTest();
            at.init();
            at.start();
    }The CSS Generator Class. This exists because once I have the basic program working I intend to expand upon it and add multiple tabs to the GUI, each one allowing the user to change different style options. Each style option to be changed will be changed wit ha different method in this class.
    public class CSSGenerator {
        //Variables
        String background = "";
        ArrayList<String> backgroundCSS;
        //Flags
        boolean backgroundChanged = false;
        //Sets and Gets
        //For Variables
        public void setBackground(String theBackground){
            background = theBackground;
        public String getBackground(){
            return background;
        //For Flags
        public void setBackgroundChanged(boolean isBackgroundChanged){
            backgroundChanged = isBackgroundChanged;
        public boolean getBackgroundChanged(){
            return backgroundChanged;
        //background generator
        public ArrayList<String> backgroundGenerator(String backgroundURL){
            //get the URL for the background
            backgroundURL = background;
            //creat a new array list of strings
            ArrayList<String> backgroundCSS = new ArrayList<String>();
            //add the strings for the background options to the array list
            backgroundCSS.add("body");
            backgroundCSS.add("{");
            backgroundCSS.add("background-image: url(" + backgroundURL + ");");
            backgroundCSS.add("background-color: #ff0000");
            backgroundCSS.add("}");
            return backgroundCSS;
        //Write CSS to File
        public void outputCSSFile(){
            try{
                //Create CSS file
                System.out.print("creating file");
                FileWriter cssWriter = new FileWriter("C:/Documents and Settings/Gwilym/My Documents/Applet Data/CustomStyle.css");
                System.out.print("file created");
                System.out.print("creating buffered writer");
                BufferedWriter out = new BufferedWriter(cssWriter);
                System.out.print("buffered writer created");
                //check which settings have been changed
                //check background flag
                if(getBackgroundChanged() == true){
                    System.out.print("retrieving arraylist");
                    ArrayList<String> tempBGOptions = backgroundGenerator(getBackground());
                    System.out.print("arraylist retrieved");
                    int j = tempBGOptions.size();
                    for(int i = 0; i < j ; i++){
                        System.out.print("writing to the file");
                        out.write(tempBGOptions.get(i));
                        out.newLine();
                        System.out.print("written to the file");
                out.close();
            }catch (Exception e){//Catch exception if any
                System.out.println("Error: Failed to write CSS file");
        /** Creates a new instance of CSSGenerator */
        public CSSGenerator() {
    }The Backgrounds Class. This class exists because I didnt want there to just be a hardcoded lsit of backgrounds, I wanted it to be possible to add new ones to the list without simply lettign users upload their own images (since the intended users are kids and this sharepoint site is used for educational purposes, I dont want them uplaoded inapropraite backgrounds) but I do want the site admin to be able to add more images to the list. for this reason the backgrounds are taken from a list in a text file that will be stored in the same location as the applet, the file specifies the background name, where it is stored, and where a thumbnail image is stored.
    public class Backgrounds {
        //Array Lists
        private ArrayList<JPanel> backgroundsList;
        private ArrayList<String> backgroundsData;
        //Set And Get Methods
        public ArrayList getBackgroundsList(){
            return backgroundsList;
        //ArrayList Population Methods
        public void populateBackgroundsData(){
            //decalre the input streams and create a new fiel hat points to the BackgroundsData file
            File backgroundsDataFile = new File("C:/Documents and Settings/Gwilym/My Documents/Applet Data/BackgroundsData.txt");
            FileInputStream backgroundsFIS = null;
            BufferedInputStream backgroundsBIS = null;
            DataInputStream backgroundsDIS = null;
            try {
                backgroundsFIS = new FileInputStream(backgroundsDataFile);
                backgroundsBIS = new BufferedInputStream(backgroundsFIS);
                backgroundsDIS = new DataInputStream(backgroundsBIS);
                backgroundsData = new ArrayList<String>();
                String inputtedData = null;
                //loops until it reaches the end of the file
                while (backgroundsDIS.available() != 0) {
                    //reads in the data to be stored in an array list
                    inputtedData = backgroundsDIS.readLine();
                    backgroundsData.add(inputtedData);
            //TESTING
            System.out.println("\n\nTESTING: populateBackgroundsData()");
            int j = backgroundsData.size();
            for(int i = 0; i < j; i++){
                System.out.println("Index " + i + " = " + backgroundsData.get(i));
            System.out.println("\n\n");
            //close all stremas
            backgroundsFIS.close();
            backgroundsBIS.close();
            backgroundsDIS.close();
            } catch (FileNotFoundException e) {
                System.out.println("Error: File Not Found");
            } catch (IOException e) {
                System.out.println("Error: IO Exception Thrown");
        public void populateBackgroundsList(){
            backgroundsList = new ArrayList<JPanel>();
            int j = backgroundsData.size();
            System.out.println("number of backgrounds = " + j);
            backgroundsList = new ArrayList<JPanel>();
            for(int i = 0; i < j; i++){
                String tempBackgroundData = backgroundsData.get(i);
                JPanel backgroundJP = new JPanel(new GridLayout(1,2));
                JLabel backgroundNameJL = new JLabel();               
                JLabel backgroundIconJL = new JLabel();
                //split the string string and egt the background name and URL
                String[] splitBGData = tempBackgroundData.split(",");
                String backgroundName = splitBGData[0];
                String backgroundURL = splitBGData[1];
                String backgroundIcon = splitBGData[2];
                System.out.println("\nbackgroundName = " + backgroundName);
                System.out.println("\nbackgroundURL = " + backgroundURL);
                System.out.println("\nbackgroundIcon = " + backgroundIcon + "\n");
                backgroundNameJL.setText(backgroundName);
                backgroundIconJL.setIcon(new javax.swing.ImageIcon(backgroundIcon));
                backgroundJP.add(backgroundNameJL);
                backgroundJP.add(backgroundIconJL);
                backgroundJP.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
                //Name the JP as the background URL so it can be found
                //May be useful sicne the data file may need to contain 3 fields in future
                //this is incase the preview image (icon) is different from the acctual background
                //most liekly in the case of more complex ppictures rather then repeating patterns
                backgroundJP.setName(backgroundURL);
                //Add the JP to the Array List
                backgroundsList.add(backgroundJP);
            //TESTING
            System.out.println("\n\nTESTING: populateBackgroundsList()");
            j = backgroundsList.size();
            for(int i = 0; i < j; i++){
                System.out.println("Index " + i + " = " + backgroundsList.get(i));
            System.out.println("\n\n");
    }So thats my program so far, if theres anythign that needs clarifying then please jsut ask. Thank you very much for the help!

Maybe you are looking for