Java 3D a problem with switching appearances

I'm writing an application which allows to change primitive objects' ( sphere, box and cone- objects are changed with JComboBox) properties via user interface. It has a few panels each for different attributes group ( on the basis of Appearance class ). There is one main appearance which attributes are adjusted in the user interface, there are also three default appearances, one for each object. When I want to change the appearance of some object I just apply the main appearance to the desired object and change the values of attributes. And there's my problem. When I switch between the objects the main appearance is applied to each of them and so are the changes made after the switching. I tried to fix it in some ways.
1. I tried going back to the default appearance after changing another object. For instance.. I chose sphere and operated on it.. then I switch to cone so I change sphere appearance back to its default and apply the main appearance to cone. But it obviously didn't work as I want to keep changes made on every object ( here: sphere).
2. I tried to put the values of main appearance in the default sphere's appearance:
sphereAppearance = mainAppearance;
sphere.setAppearance(sphereAppearance); // previously the mainAppearance was set
But it also didn't work. The changes are made on every choosen object.
3. I also tried to apply attributes of the main appearance to the default appearance of the object:
boxAppearance.setPointAttributes(mainAppearance.getPointAttributes());
     boxAppearance.setLineAttributes(mainAppearance.getLineAttributes());
But it turned out that getPointAttributes() and getLineAttributes() and so on return the object of current Point, Line..... Attributes object which were defined:
PointAttributes pointAttributes = new PointAttributes();
     LineAttributes lineAttributes = new LineAttributes();
and attached to te mainAppearance:
mainAppearance.setLineAttributes(lineAttributes);
mainAppearance.setPointAttributes(pointAttributes);
So it also ended in changes being made on every choosen object (and i wanted to change only one ).
If you have any idea how to make a copy of mainAppearance that won't be affected by changes made on
mainAppearance please help me ;)

ac09
Please do not request off-forum communication by email. Discussions may be kept on the forum.
I'm blocking your post.
db
ac09 wrote:
dear friend...
Most probably YOU HAVE NOT DECLARED THE CLASS AS PUBLIC if rest are right...
So make it....
& there is nothing like brand new....
contact : [email address removed]

Similar Messages

  • Problem with switching appearances

    I'm writing an application which allows to change primitive objects' ( sphere, box and cone- objects are changed with JComboBox) properties via user interface. It has a few panels each for different attributes group ( on the basis of Appearance class ). There is one main appearance which attributes are adjusted in the user interface, there are also three default appearances, one for each object. When I want to change the appearance of some object I just apply the main appearance to the desired object and change the values of attributes. And there's my problem. When I switch between the objects the main appearance is applied to each of them and so are the changes made after the switching. I tried to fix it in some ways.
    1. I tried going back to the default appearance after changing another object. For instance.. I chose sphere and operated on it.. then I switch to cone so I change sphere appearance back to its default and apply the main appearance to cone. But it obviously didn't work as I want to keep changes made on every object ( here: sphere).
    2. I tried to put the values of main appearance in the default sphere's appearance:
    sphereAppearance = mainAppearance;
    sphere.setAppearance(sphereAppearance); // previously the mainAppearance was set
    But it also didn't work. The changes are made on every choosen object.
    3. I also tried to apply attributes of the main appearance to the default appearance of the object:
    boxAppearance.setPointAttributes(mainAppearance.getPointAttributes());
    boxAppearance.setLineAttributes(mainAppearance.getLineAttributes());
    But it turned out that getPointAttributes() and getLineAttributes() and so on return the object of current Point, Line..... Attributes object which were defined:
    PointAttributes pointAttributes = new PointAttributes();
    LineAttributes lineAttributes = new LineAttributes();
    and attached to te mainAppearance:
    mainAppearance.setLineAttributes(lineAttributes);
    mainAppearance.setPointAttributes(pointAttributes);
    So it also ended in changes being made on every choosen object (and i wanted to change only one ).
    If you have any idea how to make a copy of mainAppearance that won't be affected by changes made on
    mainAppearance please help me ;)

    Hi @Unbuff ,
    Welcome to the HP Forums!
    It is a terrific place to find answers.
    For you to have the best experience in the HP forum I would like to direct your attention to the HP Forums Guide Learn How to Post and More
    I understand you are unable to select the headphones as the default device and therefore the sound in Skype is coming through the speakers.
    Have  you ran the   HP Support Assistant   to help with HP updates and resolving issues?
    If you connect your headphones to another PC do they work and get recognized correctly?
    When you have your headphones connected is there an error on them in Device Manager?
    To assist you I will need some information. What exact HP notebook do you have?
    How Do I Find My Model Number or Product Number?
    What Operating System are you running?
    Sparkles1
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the bottom right to say “Thanks” for helping!

  • Problem with switching tabs in top level navigation for Roles

    Hi,
    I've created two tabs (based on two roles) in the portal top level navigation menu. When clicking the first one it opens as it should. Then when clicking on the second tab it will not open, instead the first tab open up again, it sort of switches back automatically.These  two roles  are  basically consists of worksets and iviews(accessing to r/3).
    Does anyone have any expericene with this type of problem?
    please  suggest me
    Thanks
    Aravinda

    Hi Aravinda
    Please check this link
    Re: Problem with switching tabs in top level navigation
    Regards
    Geogi

  • Cp1700 - Any problems with switching existing printer with stored printer?

    I am having problems reading the LCD panel for my cp1700 (not all the text shows - common problem). I have another cp1700 that I have had stored for about 5 years (saving for parts. I think this "stored" printer squeaked when printing). I considered switching the LCD panels but it looks as if this is a complicated procedure. So I am wondering if I will encounter any problems with switching the printers? I will be putting in new ink cartridges but wondering if the printheads will cause a problem after being stored for so long?

    This don't completely resolve your concerns, but I've had no trouble printing from OS X 10.7 to an Epson Artisan 810 connected to a Mac running OS X 10.6.8.  I may even have been able to print to it wirelessly, but I can't remember.  Apple issued an update to the Epson printer drivers fairly recently, which one would hope would have addressed any issues.  In any case, I'd make a bootable clone of your Mac before you upgrade.  If things aren't as you hope, then you can restore the clone to your main disk drive and be back with OS X 10.6.

  • [svn:fx-trunk] 8277: Use blendMode="normal" to fix problems with disabled appearance when baseColor is set.

    Revision: 8277
    Author:   [email protected]
    Date:     2009-06-25 17:46:00 -0700 (Thu, 25 Jun 2009)
    Log Message:
    Use blendMode="normal" to fix problems with disabled appearance when baseColor is set.
    Bugs: SDK-19745, SDK-19762
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-19745
        http://bugs.adobe.com/jira/browse/SDK-19762
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/PanelSkin.mxml
        flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/TextAreaSkin.mxml
        flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/TextInputSkin.mxml

    This bug figures out also when creating a custom spark ComboBox, then trying to programatically update the userProposedSelectedIndex property. The proposed selected index is selected, but does not apply the same skin as when mouse is on rollover or item is selected due to up and down keys.
    The issue seems like updating the status of the item renderer to rollover or selected to get the same skin applied.
    Please could you attach DropDow nList.as that you edited ?
    Thank you so much.

  • Problem with switch-statement & ä, ö, ü

    Hi all,
    I am doing this Java online tutorial right now and have a problem with one of the exercises. Hopefully you can help me:
    I have to write a program that determines the number of consonants, vowels, punctuation characters, and spaces in an input line. I found a solution, but have two questions about it:
    •     I’m unable to calculate the amount of umlauts (ä, ö, ü). Somehow the program doesn’t recognize those characters. Why?
    •     In general I’m not very happy with this huge list of “cases”. How would you solve a problem like this? Is there a more convenient/elegant way?
    Thanks in advance!
    Write a program that determines the number of consonants, vowels, punctuation characters, and spaces in an input line.
    Read in the line into a String (in the usual way). Now use the charAt() method in a loop to access the characters one by one.
    Use a switch statement to increment the appropriate variables based on the current character. After processing the line, print out
    the results.
    import java.util.Scanner;
    class Kap43A1
      public static void main ( String[] args )
        String line;
        char letter;
        int total, countV=0, countC=0, countS=0, countU=0, countP=0;
        Scanner scan = new Scanner(System.in);
        System.out.println( "Please write a sentence " );
        line = scan.nextLine();
        total=line.length(); //Gesamtanzahl an Zeichen des Satzes
        for (int counter=0; counter<total; counter++)
          letter = line.charAt(counter); //ermitteln des Buchstabens an einer bestimmten Position des Satzes
          switch (letter)
            case 'A': case 'a':
            case 'E': case 'e':
            case 'I': case 'i':
            case 'O': case 'o':
            case 'U': case 'u':
              countV++;
              break;
            case 'B': case 'b': case 'C': case 'c': case 'D': case 'd': case 'F': case 'f': case 'G': case 'g': case 'H': case 'h':
            case 'J': case 'j': case 'K': case 'k': case 'L': case 'l': case 'M': case 'm': case 'N': case 'n': case 'P': case 'p':
            case 'Q': case 'q': case 'R': case 'r': case 'S': case 's': case 'T': case 't': case 'V': case 'v': case 'W': case 'w':
            case 'X': case 'x': case 'Y': case 'y': case 'Z': case 'z':
              countC++;
              break;
            case ' ':
              countS++;
              break;
            case ',': case '.': case ':': case '!': case '?':
              countP++;
              break;
            case 'Ä': case 'ä': case 'Ö': case 'ö': case 'Ü': case 'ü':
              countU++;
              break;
        System.out.println( "Total amount of characters:\t" + total );
        System.out.println( "Number of consonants:\t\t" + countC );
        System.out.println( "Number of vocals:\t\t" + countV );
        System.out.println( "Number of umlauts:\t\t" + countU );
        System.out.println( "Number of spaces:\t\t" + countS );
        System.out.println( "Number of punctuation chars:\t" + countP );
    }

    WRE wrote:
    •In general I’m not very happy with this huge list of “cases”. How would you solve a problem like this? Is there a more convenient/elegant way?I've been doing this a lot lately myself evaluating documents with 20 or so million words. Few tips:
    1. Regular expressions can vastly reduce the list of cases. For example you can capture all letters from a to z or A to Z as follows [a-zA-Z]. To match a single character in a String you can then make use of the Pattern and Matcher classes, and incorporate the regular expression. e.g.
      //Un-compiled code, may contain errors.
      private Pattern letterPattern = Pattern.compile("[a-zA-Z]");
      public int countNumberOfLettersInString(final String string) {
        int count = 0;
        Matcher letterMatcher = letterPattern.matcher(string);
        while(letterMatcher.find()) {
          count++;
        return count;
      }2. As mentioned above, Sets are an excellent choice. Simply declare a static variable and instantiate it using a static initializer block. Then loop over the String to determine if the character is in the given set. e.g.
      //Un-compiled code, may contain errors.
      private static Set<Character> macrons = new HashSet<Character>();
      static {
        macrons.add('ä');
        macrons.add('ö');
        macrons.add('ü');
      public int countNumberOfMacronsInString(final String string) {
        int count = 0;
        for(char c : string.toCharArray()) {
          if(macrons.contains(c) {
            count++;
        return count;
      }Mel

  • Java Console Launch Problems with CITRIX

    I have to use a Citrix TerminalServer to connect to the SunMC Server.
    Reason is the nature of the RMI proto. RMI needs to open ports back on
    the console host. As this is not allowed in our network design, I first login to
    a CITIX T.S. , start a browser and then type the URL of the SunMC server.
    The page appeares, I select "Launch Java Console", then "Open with Java Web Start executable" and it starts Java 5. Now I would expect the Login Window, but instead of it I get a window saying:
    Checking for latest version ...
    After a while (timeout) I get:
    Unable to lauch Sun Management center
    Any ideas ?

    We opened a case at SUN and got the following statement:
    This is a know issue and actually the problem has been escalated to our developer colleagues: Bug 6665331
    Using java web start does not work on a firewalled environment. This is both on a windows as well as a solaris environment. So anyone who has enabled firewalled communication will be facing this issue. The momentarily workarounds you can apply are:
    - install the console directly on the window pc or Soalris environment and use the Java GUI or
    - set the variable "sunmc.server.console.firewall.Enable=false" into java.properties file.
    --> we installed the regular (non-Web-Start) Java Console on the Citrix host. It uses the configured ports, e.g. 45000-48000. and works fine.
    I think, this will also be needed on a normal windows (non-Citrix) host.
    The second suggested workaround did not show any effects.
    Conclusion: If there is a firewall in between the server and the console, the Java WebStart Console can not be used at the moment.

  • Java Webstart application problem with TLS certificate revocation checks (Java 1.7.0_76)

    We have a problem with our Java Web Start Application regarding the TLS certificate revocation check:
    The application is running on a server within a wide area network which is separated from the internet.
    The application users have access to the WAN, and also access to the internet over some corporate proxy/firewall.
    The user has to enter, for example "https://my-site.de/myapp/ma.jnlp" within a webbrowser or could also call  "javaws https://my-site.de/myapp/ma.jnlp" to start the application client.
    The webserver has a certificate from a trusted certificate authority. This certificate seems to be ok, the browser is even configured to perform OCSP status check.
    The application files are signed with a certificate from another trusted certificate authority. This certificate seems also to be ok. Regarding this certificate there
    are no problems with certificate revocation checks.
    The problem is, while starting the application client there is a message box which tell us something like "the connection to this website ist not trustworthy",
    "Website: https://my-site.de:80", and something about an invalid certificate, meaning the webserver certificate.
    Obviously the jvm runtime, which is executed on the users workstation, tries to perform a revocation check for the webservers certificate, but this fails because
    it cannot fetch the certificate under https://my-site.de:80.
    The application will execute without further problems after that message but the users are very concerned about the "invalid" certificate, so here are my questions:
    - Why is the application trying to get the webserver certificate over Port 80. Our application developers told me, there is no corresponding statement. Calling this address
      has to fail while "https://my-site.de:443" or "https://my-site.de" would not have a problem.
    - Is there a way to make the application go on without performing a tls revocation check? I mean, by adjusting the application sourcecode and not by configuring the users Java Control Panel.
      While disabling the TLS Certificate Revocation check in the Java Control Panel, the Webstart Application executes without a warning message, but this is not a workable solution for
      our users.
    It would be great if someone can help me with a hint so i can send our developers into the right direction;-)
    Many thanks!
    This is a part from a java console output after calling "javaws -verbose https://my-site.de/myapp/"
    (sorry for this is in german... and also my english above)
    network: Verbindung von http://ocsp.serverpass.telesec.de/ocspr mit Proxy=HTTP @ internet-proxy.***:80 wird hergestellt
    network: Verbindung von http://ocsp.serverpass.telesec.de/ocspr mit Proxy=HTTP @ internet-proxy.***:80 wird hergestellt
    security: OCSP Response: GOOD
    network: Verbindung von http://ocsp.serverpass.telesec.de/ocspr mit Proxy=HTTP @ internet-proxy.***:80 wird hergestellt
    security: UNAUTHORIZED
    security: Failing over to CRLs: java.security.cert.CertPathValidatorException: OCSP response error: UNAUTHORIZED
    network: Cacheeintrag gefunden [URL: http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl, Version: null] prevalidated=false/0
    cache: Adding MemoryCache entry: http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl
    cache: Resource http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl has expired.
    network: Verbindung von http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl mit Proxy=HTTP @ internet-proxy.***:80 wird hergestellt
    network: Verbindung von http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl mit Proxy=HTTP @ internet-proxy.***:80 wird hergestellt
    network: ResponseCode für http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl: 200
    network: Codierung für http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl: null
    network: Verbindung mit http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl trennen
    CacheEntry[http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl]: updateAvailable=true,lastModified=Tue Mar 24 10:50:01 CET 2015,length=53241
    network: Verbindung von http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl mit Proxy=HTTP @ internet-proxy.***:80 wird
    network: Verbindung von socket://ldap.serverpass.telesec.de:389 mit Proxy=DIRECT wird hergestellt
    security: Revocation Status Unknown
    com.sun.deploy.security.RevocationChecker$StatusUnknownException: java.security.cert.CertPathValidatorException: OCSP response error: UNAUTHORIZED
        at com.sun.deploy.security.RevocationChecker.checkOCSP(Unknown Source)
        at com.sun.deploy.security.RevocationChecker.check(Unknown Source)
        at com.sun.deploy.security.RevocationCheckHelper.doRevocationCheck(Unknown Source)
        at com.sun.deploy.security.RevocationCheckHelper.doRevocationCheck(Unknown Source)
        at com.sun.deploy.security.RevocationCheckHelper.checkRevocationStatus(Unknown Source)
        at com.sun.deploy.security.X509TrustManagerDelegate.checkTrusted(Unknown Source)
        at com.sun.deploy.security.X509Extended7DeployTrustManagerDelegate.checkServerTrusted(Unknown Source)
        at com.sun.deploy.security.X509Extended7DeployTrustManager.checkServerTrusted(Unknown Source)
        at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)
        at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
        at sun.security.ssl.Handshaker.processLoop(Unknown Source)
        at sun.security.ssl.Handshaker.process_record(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
        at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
        at com.sun.deploy.net.HttpUtils.followRedirects(Unknown Source)
        at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source)
        at com.sun.deploy.net.BasicHttpRequest.doGetRequestEX(Unknown Source)
        at com.sun.deploy.cache.ResourceProviderImpl.checkUpdateAvailable(Unknown Source)
        at com.sun.deploy.cache.ResourceProviderImpl.isUpdateAvailable(Unknown Source)
        at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)
        at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)
        at com.sun.deploy.model.ResourceProvider.getResource(Unknown Source)
        at com.sun.javaws.jnl.LaunchDescFactory._buildDescriptor(Unknown Source)
        at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
        at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
        at com.sun.javaws.Main.launchApp(Unknown Source)
        at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
        at com.sun.javaws.Main.access$000(Unknown Source)
        at com.sun.javaws.Main$1.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
        Suppressed: com.sun.deploy.security.RevocationChecker$StatusUnknownException
            at com.sun.deploy.security.RevocationChecker.checkCRLs(Unknown Source)
            ... 35 more
    Caused by: java.security.cert.CertPathValidatorException: OCSP response error: UNAUTHORIZED
        at sun.security.provider.certpath.OCSP.check(Unknown Source)
        at sun.security.provider.certpath.OCSP.check(Unknown Source)
        at sun.security.provider.certpath.OCSP.check(Unknown Source)
        ... 36 more
    security: Ungültiges Zertifikat vom HTTPS-Server
    network: Cacheeintrag nicht gefunden [URL: https://my-site.de:80, Version: null]

    Add the JSF Jars to the WEB-INF/lib directory of the application. If still getting error add to the CLASSPATH variable in the startWebLogic script in the domain/bin directory.

  • Java Front-end problems with Windows 200 Pro

    Hi,
    I have some problem on my pc with java applications front-end. I have windows 2000 Professional and use java(TM) 2 SDK, Standard Edition Version 1.3.1
    Using every java applications (also development environment as JBuilder 4 Professional and Together 4) I have always problems with front-end: the text is bad visualized everytime I use the scroolbar, menu items into a menu are bad visualized while I drag over of them the mouse and so on...
    To try to solve this my problem I have just installed Service Pack 2 for Windows 2000 Pro but I have not had good results - I keep to have the usual problem.
    I'm aware that it is difficult to reproduce and however if anyone has some idea to solve my problem I am opened to every suggestion.
    Thanks in advance

    the text says that what technolody that they are using its called "Off Screen Images" once i used them in my applications to improve the prefomance.
    What they says is to improve the time it takes to display componants that display text on them (Such as buttons, Labels...) they going to create an Off Screen Image of the text and then paste that image on to the screen whenever the componant has to be displayed/Re displayed instead of redrowing (Re rendering) the text on the screen repeatedly which take more time and processing power than rendering once and paste it to screen whenever needed but this solution will take some more memory.

  • Having problem with switching it on

    please am having problem with my iphone 4_the apple logo turning on and off when connected  to my laptop.
    I can't switch it on when disconnected from ma laptop

    Perhaps your battery is bad.
    Have you had problems with decreasing battery life in the past?

  • Portg R600-11B - Problems with switching displays

    Hi,
    I've a problem with a Portg R600-11B running Windows 7 64bit.
    The computer is nomally plugged in a docking station that is connected with a DVI monitor. Here I can select with <FN> + <F5> between the different display modi "internal" / "internal" + "DVI" / "DVI".
    When I unplug the computer from the docking station and connect it to a beamer via VGA I can't switch the display. I only get "internal". Only after a system-reboot <FN> + <F5> works with an external VGA monitor.
    When switching back to the docking station with the DVI monitor it's the same: I only get the internal display. Only after a system-reboot <FN> + <F5> works.
    What can I do? I have the latest Microsoft Updates for Windows and Office (2003) and the latest "Value added package" from the download page installed.
    Regards,
    Axel Martin

    Try updating:
    * BIOS
    * Display Driver
    * Mobile Extensions / TVAP
    Go to the Toshiba website to download these files.

  • Java.util.logging - Problem with setting different Levels for each Handler

    Hello all,
    I am having issues setting up the java.util.logging system to use multiple handlers.
    I will paste the relevant code below, but basically I have 3 Handlers. One is a custom handler that opens a JOptionPane dialog with the specified error, the others are ConsoleHandler and FileHandler. I want Console and File to display ALL levels, and I want the custom handler to only display SEVERE levels.
    As it is now, all log levels are being displayed in the JOptionPane, and the Console is displaying duplicates.
    Here is the code that sets up the logger:
    logger = Logger.getLogger("lib.srr.applet");
    // I have tried both with and without the following statement          
    logger.setLevel(Level.ALL);
    // Log to file for all levels FINER and up
    FileHandler fh = new FileHandler("mylog.log");
    fh.setFormatter(new SimpleFormatter());
    fh.setLevel(Level.FINER);
    // Log to console for all levels FINER and up
    ConsoleHandler ch = new ConsoleHandler();
    ch.setLevel(Level.FINER);
    // Log SEVERE levels to the User, through a JOptionPane message dialog
    SRRUserAlertHandler uah = new SRRUserAlertHandler();
    uah.setLevel(Level.SEVERE);
    uah.setFormatter(new SRRUserAlertFormatter());
    // Add handlers
    logger.addHandler(fh);
    logger.addHandler(ch);
    logger.addHandler(uah);
    logger.info(fh.getLevel().toString() + " -- " + ch.getLevel().toString() + " -- " + uah.getLevel().toString());
    logger.info("Logger Initialized.");Both of those logger.info() calls displays to the SRRUserAlertHandler, despite the level being set to SEVERE.
    The getLevel calls displays the proper levels: "FINER -- FINER -- SEVERE"
    When I start up the applet, I get the following in the console:
    Apr 28, 2009 12:01:34 PM lib.srr.applet.SRR initLogger
    INFO: FINER -- FINER -- SEVERE
    Apr 28, 2009 12:01:34 PM lib.srr.applet.SRR initLogger
    INFO: FINER -- FINER -- SEVERE
    Apr 28, 2009 12:01:40 PM lib.srr.applet.SRR initLogger
    INFO: Logger Initialized.
    Apr 28, 2009 12:01:40 PM lib.srr.applet.SRR initLogger
    INFO: Logger Initialized.
    Apr 28, 2009 12:01:41 PM lib.srr.applet.SRR init
    INFO: Preparing Helper Files.
    Apr 28, 2009 12:01:41 PM lib.srr.applet.SRR init
    INFO: Preparing Helper Files.
    Apr 28, 2009 12:01:42 PM lib.srr.applet.SRR init
    INFO: Getting PC Name.
    Apr 28, 2009 12:01:42 PM lib.srr.applet.SRR init
    INFO: Getting PC Name.
    Apr 28, 2009 12:01:42 PM lib.srr.applet.SRR init
    INFO: Finished Initialization.
    Apr 28, 2009 12:01:42 PM lib.srr.applet.SRR init
    INFO: Finished Initialization.Notice they all display twice. Each of those are also being displayed to the user through the JOptionPane dialogs.
    Any ideas how I can properly set this up to send ONLY SEVERE to the user, and FINER and up to the File/Console?
    Thanks!
    Edit:
    Just in case, here is the code for my SRRUserAlertHandler:
    public class SRRUserAlertHandler extends Handler {
         public void close() throws SecurityException {
         public void flush() {
         public void publish(LogRecord arg0) {
              JOptionPane.showMessageDialog(null, arg0.getMessage());
    }Edited by: compbry15 on Apr 28, 2009 9:44 AM

    For now I have fixed the issue of setLevel not working by making a Filter class:
    public class SRRUserAlertFilter implements Filter {
         public boolean isLoggable(LogRecord arg0) {
              if (arg0.getLevel().intValue() >= Level.WARNING.intValue()) {
                   System.err.println(arg0.getLevel().intValue() + " -- " + Level.WARNING.intValue());
                   return true;
              return false;
    }My new SRRUserAlertHandler goes like this now:
    public class SRRUserAlertHandler extends Handler {
         public void close() throws SecurityException {
         public void flush() {
         public void publish(LogRecord arg0) {
              Filter theFilter = this.getFilter();
              if (theFilter.isLoggable(arg0))
                   JOptionPane.showMessageDialog(null, arg0.getMessage());
    }This is ugly as sin .. but I cannot be required to change an external config file when this is going in an applet.
    After much searching around, this logging api is quite annoying at times. I have seen numerous other people run into problems with it not logging specific levels, or logging too many levels, etc. A developer should be able to complete configure the system without having to modify external config files.
    Does anyone else have another solution?

  • Having problem with switch statement..please help

    here my question :
    GUI-based Pay Calculator
    A company pays its employees as executives (who receive a fixed weekly salary) and hourly workers (who receive a fixed hourly salary for the first 40 hours they work in a week, and 1.5 times their hourly wage for overtime worked).
    Each category of employee has its own paycode :
    ?     Paycode 1 for executives
    ?     Paycode 2 for hourly workers
    Write a GUI-based application to compute the weekly pay for each employee. Use switch to compute each employee?s pay based on that employee?s paycode.
    Use CardLayout layout manager to display appropriate GUI components. Obtain the employee name, employee paycode and other necessary facts from the user to calculate the employee?s pay based on the employee paycode:
    ?     For paycode 1, obtain the weekly salary.
    ?     For paycode 2, obtain the hourly salary and the number of hours worked.
    You may obtain other information which you think is necessary from the user.
    Use suitable classes for the GUI elements. (You can use javax.swing package or java.awt package for the GUI elements.)
    here my code so far :
    import java.awt.;*
    import java.awt.event.;*
    import javax.swing.;*
    *public class PayrollSystem implements ItemListener {*
    JPanel cards, JTextField, textField1, JLabel, label1;
    final static String EXECUTIVEPANEL = "1.EXECUTIVE";
    final static String HOURLYPANEL = "2.HOURLY WORKER";
    public void addComponentToPane(Container pane)
    *//Put the JComboBox in a JPanel to get a nicer look.*
    JPanel comboBoxPane = new JPanel(); //use FlowLayout
    JPanel userNameAndPasswordPane = new JPanel();
    *// User Name JLabel and JTextField*
    userNameAndPasswordPane.add(new JLabel("NAME"));
    JTextField textField1 = new JTextField(25);
    userNameAndPasswordPane.add(textField1);
    *String comboBoxItems[] = { EXECUTIVEPANEL, HOURLYPANEL };*
    JComboBox cb = new JComboBox(comboBoxItems);
    cb.setEditable(false);
    cb.addItemListener(this);
    comboBoxPane.add(cb);
    *//Create the "cards".*
    JPanel card1 = new JPanel();
    card1.add(new JLabel("WEEKLY SALARY"));
    card1.add(new JTextField(6));
    card1.add(new JLabel("TOTAL PAY"));
    card1.add(new JTextField(8));
    card1.add(new JButton("CALCULATE"));
    JPanel card2 = new JPanel();
    card2.add(new JLabel("HOURLY SALARY"));
    card2.add(new JTextField(6));
    card2.add(new JLabel("TOTAL HOURS WORK"));
    card2.add(new JTextField(8));
    card2.add(new JButton("CALCULATE"));
    *//Create the panel that contains the "cards".*
    cards= new JPanel(new CardLayout());
    cards.add(card1, EXECUTIVEPANEL);
    cards.add(card2, HOURLYPANEL);
    pane.add(comboBoxPane, BorderLayout.PAGE_START);
    pane.add(userNameAndPasswordPane, BorderLayout.CENTER);
    pane.add(cards, BorderLayout.PAGE_END);
    public void itemStateChanged(ItemEvent evt)
    CardLayout cl = (CardLayout)(cards.getLayout());
    cl.show(cards, (String)evt.getItem());
    ** GUI created*
    *private static void createAndShowGUI() {*
    *//Make sure we have nice window decorations.*
    JFrame.setDefaultLookAndFeelDecorated(true);
    *//Create and set up the window.*
    JFrame frame = new JFrame("GUI PAY CALCULATOR");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    *//Create and set up the content pane.*
    PayrollSystem demo = new PayrollSystem();
    demo.addComponentToPane(frame.getContentPane());
    *//Display the window.*
    frame.pack();
    frame.setVisible(true);
    *public static void main(String[] args) {*
    *//Schedule a job for the event-dispatching thread:*
    *//creating and showing this application's GUI.*
    *javax.swing.SwingUtilities.invokeLater(new Runnable() {*
    *public void run() {*
    createAndShowGUI();
    HOW CAN I PERFORM THE SWITCH STATEMENT INSIDE THIS CODE TO LET IT FULLY FUNCTIONAL..?
    I MUST PERFORM THE SWITCH STATEMENT LIKE IN THE QUESTION..
    PLEASE HELP ME..REALLY APPRECIATED...TQ

    hi
    A switch works with the byte, short, char, and int primitive data types. So you can simply give the
    switch (month) {
                case 1: 
                            System.out.println("January");
                            break;
                case 2:  {
                            System.out.println("February");
                             break;
                case 3: {
                              System.out.println("March");
                              break;
                             }where month controlls the flow
    moreover u can go to http://www.java-samples.com/java/free_calculator_application_in_java.htm
    for reference, just replace the if statement with switch with correct syntax

  • Java update causes problems with color printing in Mac 10.5

    Had a big problem with color printing for the last two weeks. Thought the printer was broken because it would freeze and refuse to be "seen", or would generate error messages. Bought new Samsung 315, and had the SAME problem. Bought new HP CP1518ni, and had the SAME problem. Not resolved after talking to tech support at both places.
    Looked for software updates around the time of the onset of printing problems. on May 15 installed "Java for Mac OS X 10.5 update" (1.0) (am running on 10.5.8). Removed the Java preferences files (com.apple.java......plist) and restarted.
    Problem solved! Clearly not the printer.

    Hmmm. This is about the time my printer stopped printing too. I've now had two printers in my house and had trouble with both of them. What a pain we should not have to delete updates for our stuff to work together.
    Renee

  • Java card plugin problem with NetBeans 6.8

    Hi, I've got a problem with the netBeans 6.8 i couldn't add a java card plugin at all. I try to run it with the netBeans 6.7.1 and it installs the plugin and adds the java card platform, but when i try to build a sample project I've got an error:
    java.lang.NoClassDefFoundError: ${javacard/packagerClass}
    Any ideas
    Netbeans versions: 6.7.1, 6.8
    JavaCard version: JCDK3.0.2_ConnectedEdition
    OS: WindowsXP

    first idea of all: isn't there a netbeans support forum/mailing list/plugin page ?
    regards
    sebastien

Maybe you are looking for

  • WiFi & Bluetooth Not Working Since iOS 6.1.3

    I updated my 16GB iPhone 4S to iOS 6.1.3 last week. Now WiFi is turned off. The Off/On switch in Settings>Wi-Fi is grayed out and will not allow me to turn WiFi on. Bluetooth functionality is gone. When I go to Settings>Bluetooth I just see the rolli

  • Time needed to load maps?

    How long does it take to load maps via OviSuite? I have been trying to download UK (184MB) and so far it has been running for about 20minutes. At this rate it is going to take me a week to download all of the countries I visit in Western Europe. Is t

  • Old photoshop 7 - now what?

    I used Photoshop 7 forever but unfortunately realized I lost it when I bought my new computer.  I now want to get something (hopefully less expensive) that can do pretty much the same things that Photoshop 7 did.  What is a modern day equivelent and

  • Sorting on a Formula field

    Everytime I try to do a sort on the formula field below, I can't sort on the field.  It doesn't even show the field in the explorer window to sort on.  The formula is below. Sum ({fct_CurrentSales.Cases}, {@upc}) /     (tonumber(Maximum ({vw_dim_Prod

  • MDM Hierarchy Table Into Tree (Java WebDynpro)

    Hello all,             I have a requirement of showing a MDM Hierarchy Table into Tree UI element. These are the steps am following: 1) MDM Connectivity 2) Using RetrieveLimitedHierTreeCommand command to retrieve tree structure of the table 3) Using