Multiple applets help

I am very new to java and I have written several stand alone applets but when I try to call the different applets from a main they fail to load or end up in a new instance loop. Sorry if the verbage is incorrect. Here is an example of what I am trying to accomplish
public class MainLayout extends Applet implements ActionListener,MouseListener {
menuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
SwingUtilities.invokeLater(new Runnable() {
public void run()
new anotherApplet(); //not working
createAndShowFrame(); // works and creates an empty frame.
public static void createAndShowFrame() {
JFrame myFrame = new JFrame("My JFrame");
myFrame.setSize(250, 250);
myFrame.setLocation(300,200);
myFrame.getContentPane().add(BorderLayout.CENTER, new JTextArea(10, 40));
myFrame.show();
Like I said "MainLayout" runs no problem but I am unable to load "anotherApplet". However if I run anotherApplet seperately it executes correctly. Any help would be greatly appreciated.

Applet containers usually invoke a number of lifecycle methods on their applets, such as init, start, stop, destroy, etc. and provide an AppletContext. If your applets rely on any of these methods, then your attempt to execute them from a main should invoke those methods and potentially provide a context.

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).

  • 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 =)

  • How to implement multiple Value Helps within the same Application ??

    Dear Experts,
    I want to implement multiple value helps in the same view.For that I have declared exporting parameters of type 'wdy_key_value_table.' within the component controller for each of the value helps.While I do activate and test the application I get the following error :
    The following error text was processed in the system HE6 : A row with the same key already exists.
    The error occurred on the application server hsdnt24s11_HE6_00 and in the work process 4 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: VALUESET_BSART of program /1BCWDY/9VSHJWRNR0EZPKFT3ZKC==CP
    Method: IF_PO_VIEW1~VALUESET_BSART of program /1BCWDY/9VSHJWRNR0EZPKFT3ZKC==CP
    Method: WDDOINIT of program /1BCWDY/9VSHJWRNR0EZPKFT3ZKC==CP
    Method: IF_WDR_VIEW_DELEGATE~WD_DO_INIT of program /1BCWDY/9VSHJWRNR0EZPKFT3ZKC==CP
    Method: DO_INIT of program CL_WDR_DELEGATING_VIEW========CP
    Method: INIT_CONTROLLER of program CL_WDR_CONTROLLER=============CP
    Method: INIT_CONTROLLER of program CL_WDR_VIEW===================CP
    Method: INIT of program CL_WDR_CONTROLLER=============CP
    Method: GET_VIEW of program CL_WDR_VIEW_MANAGER===========CP
    Method: BIND_ROOT of program CL_WDR_VIEW_MANAGER===========CP
    I dont know how to implement multiple value helps.Need your help on this.
    Regards,
    Mamai.

    Hi
    Hint is : A row with the same key already exists it means , It is assigning the same value/Key to row and you are calling it at WDDOINIT  so it giving error at the time of initialization .
    Better way to do the coding at some event in view OR if not possible than just execute the first value help in wddoinit later clear all the value before gettig the other Value help. Code it at WdDoModify View to get its run time behaviour.
    BR
    Satish Kumar

  • 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

  • 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

  • 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

  • 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...

  • 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

  • applet code multiple classes help :(

    Ok, i made an applet which have 2 .class files one is AppTs.class and other is MyPot.class, what I need to write to lets say index.html
    to make that applet viewable in browser. Thx.
    I try this but it say Applet failed to load...
    <HTML>
    <BODY>
    <APPLET CODE=AppTs.class WIDTH=200 HEIGHT=100>
    <APPLET CODE=MyPot.class WIDTH=200 HEIGHT=100>
    </APPLET>
    </BODY>
    </HTML>

    Are you sure, could be because, I am using Pirc bot Framework, which isn't in standard Java libraries, is maybe that causing problem, because, applet works perfectly when i run it from Eclipse IDE.
    And that your HTML code that you write, it makes 2 applets, but i need only one because GUI is only in AppTs, why is that happening neither?
    Edited by: systat on Mar 28, 2008 11:35 AM

  • Multiplication Applet gone horribly awry.

    Some of the grunge:
    I used a BorderLayout, with the multipliers in the NORTH and SOUTH. The table itself is a Panel, with a 9 by 9 GridLayout. The values are stored in the Panel as Labels, and each Label is also part of an array in the Applet. The applet implements TextListener to watch the multipliers, and as the multipliers change the appropriate Labels have their background and foreground colors changed with setBackground() and setForeground.
    This is what i was supposed to do, im already way too late to actually pass this in for any credit at this point i just want to get it to work and understand how it works, here is the code i have:
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.lang.String;
    import java.util.Arrays;
    public class multiplier extends Applet{
          Label First = new Label();
          int columnNumber, rowNumber;
          int idx = 0;
          String Labels[];
         TextField tf1 = new TextField();
         TextField tf2 = new TextField();
    private TextArea txtarea = new TextArea();
         public void init(){
              Panel p = new Panel();
              p.setLayout(new BorderLayout());
              p.add(tf1, BorderLayout.NORTH);
              p.add(tf2, BorderLayout.SOUTH);
              Panel p2 = new Panel();
              p2.setLayout(new GridLayout(9,9));
              p.add(p2, BorderLayout.CENTER);
              for(rowNumber=1;rowNumber<=9;rowNumber++){
                   //System.out.print(rowNumber + "\t   ");
                   for(columnNumber=2;columnNumber<=9;columnNumber++){
                        //System.out.print(columnNumber*rowNumber + "\t   ");
                   Labels[idx++]=(""+(columnNumber*rowNumber));
                   //System.out.println(Arrays.toString(Labels));
                   //System.out.print("\n");
    }My first problem, my for loop generates the actual values for the multiplication table and they are stored in my Array called Labels, but how do i Add Labels into panel 2???
    Thanks, any help would be appreciated

    that line of code seemed to work perfectly but now something odd is happening. It compiled and ran without and exceptions, but it went right to a blank screen, but when i clicked reload it flashed the table i wanted with the text areas above and below it then went back to blank screen?!? heres the updated code:
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.lang.String;
    import java.util.Arrays;
    public class multiplier extends Applet{
          Label First = new Label();
          int columnNumber, rowNumber;
          int idx = 0;
          String Labels[];
         TextField tf1 = new TextField();
         TextField tf2 = new TextField();
    private TextArea txtarea = new TextArea();
         public void init(){
              Panel p = new Panel();
              p.setLayout(new BorderLayout());
              p.add(tf1, BorderLayout.NORTH);
              p.add(tf2, BorderLayout.SOUTH);
              Panel p2 = new Panel();
              p2.setLayout(new GridLayout(9,9));
              for(rowNumber=1;rowNumber<=9;rowNumber++){
                   for(columnNumber=2;columnNumber<=9;columnNumber++){
                   p2.add(new Label(" " + (columnNumber*rowNumber)));
                   p.add(p2, BorderLayout.CENTER);
                   this.add(p);
                   //System.out.print("\n");
    }

  • Simple button applet help

    ok, i'm working on a project involving buttons, and i finished it and it compiles fine, but when i run the applet (using textpad), nothign shows up.
    i decided to make a new applet of only the frame and buttons, and i got the same problem. here is the simple one.
    import java.util.*;
    import java.applet.Applet;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    public class framek extends JApplet
         public static final int WIDTH = 600;
         public static final int HEIGHT = 300;
         public void framek()
              JFrame myWindow = new JFrame();
              myWindow.setSize(WIDTH, HEIGHT);
         Container contentPane = myWindow.getContentPane();
              contentPane.setBackground(Color.blue);
              contentPane.setLayout(new BorderLayout());
              JPanel button = new JPanel();
              button.setLayout(new FlowLayout());
              JButton convert = new JButton("Translate");
              button.add(convert);
              JButton delete = new JButton("Delete");
              button.add(delete);
              contentPane.add(button, BorderLayout.SOUTH);
    i might have made some mistakes in the shortening of my project (such as variables that arent used) but i just need help with getting the buttons and background things to show. I used very similar programs in a textbook and on the web to check and they worked fine on textpad, and this doesnt. its probably a very simple thing that i forgot but i cant find it yet, as i am fairly new to swing.
    any help is appreciated thanks

    /*  <applet code="HelloApplet" width="600" height="300"></applet>
    *  use: >appletviewer HelloApplet.java
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class HelloApplet extends JApplet
        public static final int WIDTH = 600;
        public static final int HEIGHT = 300;
        public void init()
            Container contentPane = getContentPane();
            contentPane.setBackground(Color.blue);
            contentPane.setLayout(new BorderLayout());
            JPanel button = new JPanel();
            button.setLayout(new FlowLayout());
            JButton convert = new JButton("Translate");
            button.add(convert);
            JButton delete = new JButton("Delete");
            button.add(delete);
            contentPane.add(button, BorderLayout.SOUTH);
        /** this is a convenience method */
        public static void main(String[] args)
            JApplet applet = new HelloApplet();
            JFrame myWindow = new JFrame();
            myWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            myWindow.add(applet);
            myWindow.setSize(WIDTH, HEIGHT);
            myWindow.setLocation(200,200);
            applet.init();
            myWindow.setVisible(true);
    }

  • Multiple search help

    hi all,
    is it a possible to create search help with checkbox or something similar where user can chose several lines and return values
    on scree  ( several lines-intervals).
    Similar situation is on logical base PCH when you chose object ID and have check box.

    Hi Nick,
    After creating the search help you can create a Search Help exit and in that you can enable multiple selection and the system will automatically display check boxes for you to choose multiple entries.
    Regards
    Bala

  • Using my new GUI component in an applet :Help!!!

    I am seeking help for the following
    Define class MyColorChooser as a new component so it can be reused in other applications or applets. We want to use the new GUI component as part of an applet that displays the current Color value.
    The following is the code of MyColorChooser class
    * a) We define a class called MyColorChooser that provides three JSlider
    * objects and three JTextField objects. Each JSlider represents the values
    * from 0 to 255 for the red, green and blue parts of a color.
    * We use wred, green and blue values as the arguments to the Color contructeur
    * to create a new Color object.
    * We display the current value of each JSlider in the corresponding JTextField.
    * When the user changes the value of the JSlider, the JTextField(s) should be changed
    * accordingly as weel as the current color.
    * b)Define class MyColorChooser so it can be reused in other applications or applets.
    * Use your new GUI component as part of an applet that displays the current
    * Color value.
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.event.*;
    import java.text.DecimalFormat;
    public class MyChooserColor extends JFrame{
         private int red, green, blue;  // color shade for red, green and blue
         private static Color myColor;  // color resultant from red, green and blue shades
         private JSlider mySlider [];      
         private JTextField textField [];
    // Panels for sliders, textfields and button components
         private JPanel mySliderPanel, textFieldPanel, buttonPanel;
    // sublcass objet of JPanel for drawing purposes
         private CustomPanel myPanel;
         private JButton okButton, exitButton;
         public MyChooserColor ()     
              super( "HOME MADE COLOR COMPONENT; composition of RGB values " );
    //       setting properties of the mySlider array and registering the events
              mySlider = new JSlider [3];
              ChangeHandler handler = new ChangeHandler();
              for (int i = 0; i < mySlider.length; i++)
              {     mySlider[i] = new JSlider( SwingConstants.HORIZONTAL,
                               0, 255, 255 );
                   mySlider.setMajorTickSpacing( 10 );
                   mySlider[i].setPaintTicks( true );
    //      register events for mySlider[i]
                   mySlider[i].addChangeListener( handler);                     
    //      setting properties of the textField array           
              textField = new JTextField [3];          
              for (int i = 0; i < textField.length; i++)
              {     textField[i] = new JTextField("100.00%", 5 );
                   textField[i].setEditable(false);
                   textField[i].setBackground(Color.white);
    // initial Background color of each slider and foreground for each textfield
    // accordingly to its current color shade
              mySlider[0].setBackground(
                        new Color ( mySlider[0].getValue(), 0, 0 ) );
              textField[0].setForeground(
                        new Color ( mySlider[0].getValue(), 0, 0 ) );           
              mySlider[1].setBackground(
                        new Color ( 0, mySlider[1].getValue(), 0 ) );
              textField[1].setForeground(
                        new Color ( 0, mySlider[1].getValue(), 0 ) );
              mySlider[2].setBackground(
                        new Color ( 0, 0, mySlider[2].getValue() ) );
              textField[2].setForeground(
                        new Color ( 0, 0, mySlider[2].getValue() ) );
    // initialize myColor to white
              myColor = Color.WHITE;
    // instanciate myPanel for drawing purposes          
              myPanel = new CustomPanel();
              myPanel.setBackground(myColor);
    // instanciate okButton with its inanymous class
    // to handle its related events
              okButton = new JButton ("OK");
              okButton.setToolTipText("To confirm the current color");
              okButton.setMnemonic('o');
              okButton.addActionListener(
                   new ActionListener(){
                        public void actionPerformed (ActionEvent e)
                        {     // code permetting to transfer
                             // the current color to the parent
                             // component backgroung color
                             //System.exit( 0 );     
    //      instanciate exitButton with its inanymous class
    //      to handle its related events           
              exitButton = new JButton("Exit");
              exitButton.setToolTipText("Exit the application");
              exitButton.setMnemonic('x');
              exitButton.addActionListener(
                        new ActionListener(){
                             public void actionPerformed (ActionEvent e)
                             {     System.exit( 0 );     
    // define the contentPane
              Container c = getContentPane();
              c.setLayout( new BorderLayout() );
    //     panel as container for sliders
              mySliderPanel = new JPanel(new BorderLayout());
    //      panel as container for textFields           
              textFieldPanel = new JPanel(new FlowLayout());
    //      panel as container for Jbuttons components           
              buttonPanel = new JPanel ();
              buttonPanel.setLayout( new BoxLayout( buttonPanel, BoxLayout.Y_AXIS ) );
    //add the Jbutton components to buttonPanel           
              buttonPanel.add(okButton);
              buttonPanel.add(exitButton);
    //     add the mySlider components to mySliderPanel
              mySliderPanel.add(mySlider[0], BorderLayout.NORTH);
              mySliderPanel.add(mySlider[1], BorderLayout.CENTER);
              mySliderPanel.add(mySlider[2], BorderLayout.SOUTH);
    //add the textField components to textFieldPanel     
              for (int i = 0; i < textField.length; i++){
                   textFieldPanel.add(textField[i]);
    // add the panels to the container c          
              c.add( mySliderPanel, BorderLayout.NORTH );
              c.add( buttonPanel, BorderLayout.WEST);
              c.add( textFieldPanel, BorderLayout.SOUTH);
              c.add( myPanel, BorderLayout.CENTER );
              setSize(500, 300);          
              show();               
    //     inner class for mySlider events handling
         private class ChangeHandler implements ChangeListener {          
              public void stateChanged( ChangeEvent e )
    // start by collecting the current color shade
    // for red , forgreen and for blue               
                   setRedColor(mySlider[0].getValue());
                   setGreenColor(mySlider[1].getValue());
                   setBlueColor(mySlider[2].getValue());
    //The textcolor in myPanel (subclass of JPanel for drawing purposes)
                   myPanel.setMyTextColor( ( 255 - getRedColor() ),
                             ( 255 - getGreenColor() ), ( 255 - getBlueColor() ) );
    //call to repaint() occurs here
                   myPanel.setThumbSlider1( getRedColor() );
                   myPanel.setThumbSlider2( getGreenColor() );
                   myPanel.setThumbSlider3( getBlueColor() );
    // display color value in the textFields (%)
                   DecimalFormat twoDigits = new DecimalFormat ("0.00");
                   for (int i = 0; i < textField.length; i++){
                        textField[i].setText("" + twoDigits.format(
                                  100.0* mySlider[i].getValue()/255) + " %") ;
    // seting the textcolor for each textField
    // and the background color for each slider               
                   textField[0].setForeground(
                             new Color ( getRedColor(), 0, 0 ) );
                   mySlider[0].setBackground(
                             new Color ( getRedColor(), 0, 0) );
                   textField[1].setForeground(
                             new Color ( 0, getGreenColor() , 0 ) );
                   mySlider[1].setBackground(
                             new Color ( 0, getGreenColor(), 0) );
                   textField[2].setForeground(
                             new Color ( 0, 0, getBlueColor() ) );
                   mySlider[2].setBackground(
                             new Color ( 0, 0, getBlueColor() ) );
    // color of myPanel background
                   myColor = new Color (getRedColor(),
                             getGreenColor(), getBlueColor());
                   myPanel.setBackground(myColor);               
    // set methods to set the basic color shade
         private void setRedColor (int r){
              red = ( (r >= 0 && r <= 255) ? r : 255 );
         private void setGreenColor (int g){
              green = ( (g >= 0 && g <= 255) ? g : 255 );
         private void setBlueColor (int b){
              blue = ( (b >= 0 && b <= 255) ? b : 255 );
    // get methods (return the basic color shade)
         private int getRedColor (){
              return red ;
         private int getGreenColor (){
              return green;
         private int getBlueColor (){
              return blue;
         public static Color getMyColor (){
              return myColor;
    // main method                
         public static void main (String args []){
              MyChooserColor app = new MyChooserColor();
              app.addWindowListener(
                        new WindowAdapter() {
                             public void windowClosing( WindowEvent e )
                             {     System.exit( 0 );
    // inner class CustomPanel for drawing purposes
         private class CustomPanel extends JPanel {
              private int thumbSlider1 = 255;
              private int thumbSlider2 = 255;
              private int thumbSlider3 = 255;
              private Color myTextColor;
              public void paintComponent( Graphics g )
                   super.paintComponent( g );
                   g.setColor(myTextColor);
                   g.setFont( new Font( "Serif", Font.TRUETYPE_FONT, 12 ) );
                   DecimalFormat twoDigits = new DecimalFormat ("0.00");
                   g.drawString( "The RGB values of the current color are : "
                             + "( "     + thumbSlider1 + " , " + thumbSlider2 + " , "
                             + thumbSlider3 + " )", 10, 40);
                   g.drawString( "The current background color is composed by " +
                             "the folllowing RGB colors " , 10, 60);
                   g.drawString( "Percentage of RED from slider1 : "
                        + twoDigits.format(thumbSlider1*100.0/255), 10, 80 );
                   g.drawString( "Percentage of GREEN from slider2 : "
                        + twoDigits.format(thumbSlider2*100.0/255), 10, 100 );
                   g.drawString( "Percentage of BLUE from slider3 : "
                        + twoDigits.format(thumbSlider3*100.0/255), 10, 120 );
    // call to repaint occurs here     
              public void setThumbSlider1(int th){
                   thumbSlider1 = (th >= 0 ? th: 255 );
                   repaint();
              public void setThumbSlider2(int th){
                   thumbSlider2 = (th >= 0 ? th: 255 );
                   repaint();
              public void setThumbSlider3(int th){
                   thumbSlider3 = (th >= 0 ? th: 255 );
                   repaint();
              public void setMyTextColor(int r, int g, int b){
                   myTextColor = new Color(r, g, b);
                   repaint();
    //The following method is used by layout managers
              public Dimension getPreferredSize()
              {     return new Dimension( 150, 100 );
    The following is the code of application that tests the component
    //Application used to demonstrating
    // the homemade GUI MyChooserColor component
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class ShowMyColor extends JFrame {
         private JButton changeColor;
         private Color color = Color.lightGray;
         private Container c;
         MyChooserColor colorComponent;
         public ShowMyColor()
         {     super( "Using MyChooserColor" );
              c = getContentPane();
              c.setLayout( new FlowLayout() );
              changeColor = new JButton( "Change Color" );
              changeColor.addActionListener(
                        new ActionListener() {
                             public void actionPerformed( ActionEvent e )
                             {     colorComponent = new MyChooserColor ();
                                  colorComponent.show();
                                  color = MyChooserColor.getMyColor();
                                  if ( color == null )
                                       color = Color.lightGray;
                                  c.setBackground( color );
                                  c.repaint();
              c.add( changeColor );
              setSize( 400, 130 );
              show();
         public static void main( String args[] )
         {     ShowMyColor app = new ShowMyColor();
              app.addWindowListener(
                        new WindowAdapter() {
                             public void windowClosing( WindowEvent e )
                             {  System.exit( 0 );

    Yes, I want help for the missing code to add in actionPerformed method below. As a result, when you confirm the selected color (clicking the OK button), it will be transferred to a variable color of class ShowMyColor.
    // instanciate okButton with its inanymous class
    // to handle its related events
              okButton = new JButton ("OK");
              okButton.setToolTipText("To confirm the current color");
              okButton.setMnemonic('o');
              okButton.addActionListener(
                   new ActionListener(){
                        public void actionPerformed (ActionEvent e)
                        {     // code permetting to transfer
                             // the current color to the parent
                             // component backgroung color
                             //System.exit( 0 );     
              );

  • Master-Detail on multiple applets

    Any help would be greatly appreciated....What I'm trying to do is to create 2 seperate applets with a master detal relationship. For example say in applet1 I have the scott.dept table and applet2 the scott.emp table. How can i link these 2 applets so that navigation in applet 1 affects the result in applet 2.
    Thanks

    I'm not sure how to do this with two separate applets, but you can do it with two separate panels (which may be displayed in separate frames).
    Refer to the thread "Share sessionInfo?" for more info.
    -- Brian

Maybe you are looking for

  • Use of Index although a great number of rows is returned....

    Hi , I have created the following table: create table all_obj select * from all_objects; Then i created some indexes: create index idx_obj on all_obj (object_name) create index idx_owner on all_obj (owner) Then i issued the sql statement: SQL> select

  • Conditions in Receiver Determination

    Hi         I am doing a scenario in which we are sending PO from R3 to one of two different web-services through XI using RFC.We have already transported our scenario to Production.Using RFC we are executing Webservice.         Now there on productio

  • Poor SSD disk IO speed in Oracle Linux 6.3 (Windows migration)

    Hello, I am trying to migrate from Windows to Oracle Linux, but I'm seeing very poor disk IO speeds. It's probably a tuning thing, but I'm relatively new to Oracle Linux and could use some detailed advice. I took one physical server and migrated it f

  • The best cable for hdmi out ?

    any suggestions which cable would be the best to watch movies on led tv via using my macbook pro ? i saw there are nine cables which are doing the same job except one difference dwhich is the producer company so let me know which one suits my macbook

  • Help Need Captivate 2

    Adobe tech support had me unistall Captivate 2 from my pc. I originally installed it via a dowload from Adobe.com. I uninstalled it but I don' t have a copy to reinstall. Adobe Customer Service can't help because Captivate 3 is all they have. Does an