JComboBox Visibility Problem

Hi, I am trying to use JComboBox for selecting you race and gender in a RPG I am making, but The contents of the JComboBox will not appear in the small version (before you click the little arrow) unless you first move one of the JSliders... Could some one help me figure this out?
//I call the class with this
     newGamePanel = new newGamePanel();
     newGamePanel.setLayout(null);
     newGamePanel.setBounds(0, 0, programWidth, programHeight);
     newGamePanel.setBackground(Color.black);
     frame.getContentPane().add(newGamePanel);
     newGamePanel.setVisible(true);
     newGamePanel.setUpAlpha();
     newGamePanel.repaint();
//and here is my class where it all takes place...  The relivent method is setUpAlpha()
public class newGamePanel extends JPanel//Sets up and grabs the information for the character creation
implements ActionListener, ChangeListener
     JButton newGameOK;
     JTextField newGameName;
     JComboBox newGameRace, newGameGender;
     JSlider newGameSTR, newGameAGI, newGameVIT, newGameDEX, newGameINT, newGameLUK;
     JLabel nGameName, nGameRace, nGameGender, nGameSTR, nGameAGI, nGameVIT, nGameDEX, nGameINT, nGameLUK;
     int tempScrollA = 5, tempScrollB = 5, tempScrollC = 5, tempScrollD = 5, tempScrollE = 5, tempScrollF = 5;
     public void actionPerformed(ActionEvent e)//Action Performed Block
          if(e.getSource() == newGameOK)
               gameState = "Story";
               newGameGetInfo();
               newGameStoryPanel.newGameStoryPanelInit();
     public void stateChanged(ChangeEvent e)//Scrollbar Listener Block
          if(e.getSource() == newGameSTR)
               tempScrollA = 10 - (int)newGameSTR.getValue();
               newGameINT.setValue(tempScrollA);
          if(e.getSource() == newGameINT)
               tempScrollA = 10 - (int)newGameINT.getValue();
               newGameSTR.setValue(tempScrollA);
          if(e.getSource() == newGameAGI)
               tempScrollA = 10 - (int)newGameAGI.getValue();
               newGameLUK.setValue(tempScrollA);
          if(e.getSource() == newGameLUK)
               tempScrollA = 10 - (int)newGameLUK.getValue();
               newGameAGI.setValue(tempScrollA);
          if(e.getSource() == newGameDEX)
               tempScrollA = 10 - (int)newGameDEX.getValue();
               newGameVIT.setValue(tempScrollA);
          if(e.getSource() == newGameVIT)
               tempScrollA = 10 - (int)newGameVIT.getValue();
               newGameDEX.setValue(tempScrollA);
          tempScrollA = (int)newGameSTR.getValue();
          tempScrollB = (int)newGameAGI.getValue();
          tempScrollC = (int)newGameVIT.getValue();
          tempScrollD = (int)newGameDEX.getValue();
          tempScrollE = (int)newGameINT.getValue();
          tempScrollF = (int)newGameLUK.getValue();
          nGameSTR.setText("Strength: " + tempScrollA);
          nGameAGI.setText("Agility: " + tempScrollB);
          nGameVIT.setText("Vitality: " + tempScrollC);
          nGameDEX.setText("Dexterity: " + tempScrollD);
          nGameINT.setText("Intelligence: " + tempScrollE);
          nGameLUK.setText("Luck: " + tempScrollF);
     public void setUpAlpha()//Huge block to set up Character creation screen
          int tempProgramLeft = (int)(programWidth /2) - 225;
          int tempProgramRight = (int)(programWidth /2) + 25;
          UIManager.put("Label.foreground", Color.white);
          nGameName = new JLabel("Character Name", JLabel.CENTER);
          nGameName.setBounds((int)((programWidth - 250) / 2), 35, 250, 20);
          nGameRace = new JLabel("Character Race", JLabel.CENTER);
          nGameRace.setBounds(tempProgramLeft, 135, 200, 20);
          nGameGender = new JLabel("Character Gender", JLabel.CENTER);
          nGameGender.setBounds(tempProgramRight, 135, 200, 20);
          nGameSTR = new JLabel("Strength: " + tempScrollA, JLabel.CENTER);
          nGameSTR.setBounds(tempProgramLeft, 230, 200, 20);
          nGameINT = new JLabel("Intelligence: " + tempScrollE, JLabel.CENTER);
          nGameINT.setBounds(tempProgramRight, 230, 200, 20);
          nGameVIT = new JLabel("Vitality: " + tempScrollB, JLabel.CENTER);
          nGameVIT.setBounds(tempProgramLeft, 300, 200, 20);
          nGameDEX = new JLabel("Dexterity: " + tempScrollD, JLabel.CENTER);
          nGameDEX.setBounds(tempProgramRight, 300, 200, 20);
          nGameAGI = new JLabel("Agility: " + tempScrollC, JLabel.CENTER);
          nGameAGI.setBounds(tempProgramRight, 370, 200, 20);
          nGameLUK = new JLabel("Luck: " + tempScrollF, JLabel.CENTER);
          nGameLUK.setBounds(tempProgramLeft, 370, 200, 20);
          newGameOK = new JButton("Start Game", null);
          newGameOK.setHorizontalTextPosition(AbstractButton.CENTER);
          newGameOK.setBackground(Color.black);
          newGameOK.setForeground(Color.white);
          newGameOK.setBounds((int)((programWidth - 100) / 2), 450, 100, 30);
          newGameOK.setBorder(BorderFactory.createMatteBorder(3, 3, 3, 3, Color.white));
          newGameName = new JTextField("Enter Name", 20);
          newGameName.setFont(new Font("Times New Roman", Font.BOLD, 12));
          newGameName.setForeground(Color.red);
          newGameName.setBackground(Color.black);
          newGameName.setBounds((int)((programWidth - 250) / 2), 60, 250, 25);
          newGameName.setBorder(BorderFactory.createMatteBorder(2, 2, 2, 2, Color.white));
     //     UIManager.put("ComboBox.foreground", Color.red);
     //     UIManager.put("ComboBox.background", Color.black);
     //     UIManager.put("ComboBox.border", BorderFactory.createMatteBorder(0, 0, 0, 7, Color.white));
          String[] newGameRaceAAA = {"Human", "Elf", "Dwarf"};
          newGameRace = new JComboBox(newGameRaceAAA);
          newGameRace.setSelectedIndex(0);
          newGameRace.setBounds(tempProgramLeft, 160, 200, 20);
          newGameRace.addActionListener(this);
          String[] newGameGenderAAA = {"Male", "Female"};
          newGameGender = new JComboBox(newGameGenderAAA);
          newGameGender.setSelectedIndex(0);
          newGameGender.setBounds(tempProgramRight, 160, 200, 20);
          newGameGender.addActionListener(this);
          UIManager.put("Slider.background", Color.black);
          newGameSTR = new JSlider(JSlider.HORIZONTAL, 1, 9, 5);
          newGameAGI = new JSlider(JSlider.HORIZONTAL, 1, 9, 5);
          newGameVIT = new JSlider(JSlider.HORIZONTAL, 1, 9, 5);
          newGameDEX = new JSlider(JSlider.HORIZONTAL, 1, 9, 5);
          newGameINT = new JSlider(JSlider.HORIZONTAL, 1, 9, 5);
          newGameLUK = new JSlider(JSlider.HORIZONTAL, 1, 9, 5);
          newGameSTR.setBounds(tempProgramLeft, 250, 200, 15);
          newGameINT.setBounds(tempProgramRight, 250, 200, 15);
          newGameVIT.setBounds(tempProgramLeft, 320, 200, 15);
          newGameDEX.setBounds(tempProgramRight, 320, 200, 15);
          newGameLUK.setBounds(tempProgramLeft, 390, 200, 15);
          newGameAGI.setBounds(tempProgramRight, 390, 200, 15);
          visiblePanelChecker();
          this.add(newGameOK);
          this.add(newGameName);
          this.add(newGameRace);
          this.add(newGameGender);
          this.add(newGameSTR);
          this.add(newGameAGI);
          this.add(newGameVIT);
          this.add(newGameDEX);
          this.add(newGameINT);
          this.add(newGameLUK);
          this.add(nGameName);
          this.add(nGameRace);
          this.add(nGameGender);
          this.add(nGameSTR);
          this.add(nGameAGI);
          this.add(nGameVIT);
          this.add(nGameDEX);
          this.add(nGameINT);
          this.add(nGameLUK);
          newGameOK.addActionListener(this);
          newGameSTR.addChangeListener(this);
          newGameAGI.addChangeListener(this);
          newGameVIT.addChangeListener(this);
          newGameDEX.addChangeListener(this);
          newGameINT.addChangeListener(this);
          newGameLUK.addChangeListener(this);
          newGameOK.setVisible(true);
          newGameName.setVisible(true);
          newGameRace.setVisible(true);
          newGameGender.setVisible(true);
          newGameSTR.setVisible(true);
          newGameAGI.setVisible(true);
          newGameVIT.setVisible(true);
          newGameDEX.setVisible(true);
          newGameINT.setVisible(true);
          newGameLUK.setVisible(true);
          nGameName.setVisible(true);
          nGameRace.setVisible(true);
          nGameGender.setVisible(true);
          nGameSTR.setVisible(true);
          nGameAGI.setVisible(true);
          nGameVIT.setVisible(true);
          nGameDEX.setVisible(true);
          nGameINT.setVisible(true);
          nGameLUK.setVisible(true);
          repaint();
     public void newGameGetInfo()//Grabs the information from the items in the New Game
          hero = new Chara();
          hero.name = newGameName.getText();
          hero.name = hero.name.trim();
          if(hero.name.length() > 10){hero.name = hero.name.substring(0, 10);}
          hero.race = (String)newGameRace.getSelectedItem();
          hero.gender = (String)newGameGender.getSelectedItem();
          for(int i = 0; i < 2; i ++)
               hero.strength[i] = tempScrollA;
               hero.agility[i] = tempScrollB;
               hero.vitality[i] = tempScrollC;
               hero.dexterity[i] = tempScrollD;
               hero.intelligence[i] = tempScrollE;
               hero.luck[i] = tempScrollF;
          if(hero.race == "Human")
               hero.strength[2] = 1;
               hero.agility[2] = 1;
               hero.vitality[2] = 1;
               hero.dexterity[2] = 1;
               hero.intelligence[2] = 1;
               hero.luck[2] = 1;
          if(hero.race == "Elf")
               hero.strength[2] = 0;
               hero.agility[2] = 2;
               hero.vitality[2] = 0;
               hero.dexterity[2] = 2;
               hero.intelligence[2] = 2;
               hero.luck[2] = 0;
          if(hero.race == "Dwarf")
               hero.strength[2] = 3;
               hero.agility[2] = 0;
               hero.vitality[2] = 2;
               hero.dexterity[2] = 0;
               hero.intelligence[2] = 0;
               hero.luck[2] = 1;
          int hp[] = new int[3];//Min/Max HP
          int mp[] = new int[3];//Min/Max SP
          hero.level = 1;
          hero.job = "Novice";
          hero.status = "Normal";
          hero.property = "Normal";
          for(int i = 0; i < hero.location.length; i++)
               for(int a = 0; a < hero.location.length; a++)
                    hero.location[i][a] = 320;
          menuActivate();
          resetNewGameStuff();
          visiblePanelChecker();
     public void resetNewGameStuff()//Resets the values in the items for the New Game
          newGameName = null;
          newGameRace = newGameGender = null;
          newGameSTR = newGameAGI = newGameVIT = newGameDEX = newGameINT = newGameLUK = null;
          nGameSTR = nGameAGI = nGameVIT = nGameDEX = nGameINT = nGameLUK = null;

Is there anybody who can help me? I need Help guys......

Similar Messages

  • Email visibility problem fixed?

    Since I don't know how to check (and I'm really not that interested) I was wondering if someone can confirm what this e-mail I got from Sun seems to be saying:
    In other words, did they fix the e-mail hole?
    Hello,
    Thank you for writing. I am very sorry for this
    trouble and any inconvenience you experienced
    as a result. We have followed up on this matter
    and it has been fixed.
    Sincerely,
    Sun Web Team
    Sun Microsystems, Inc.
    name: ***
    url: http://forum.java.sun.com/forum.jspa?forumID=31
    descself: Software Development
    comments: The privacy hole mentioned the thread:
    http://forum.java.sun.com/thread.jspa?messageID=3938145 is serious.
    I don't feel like I can trust with my privacy details with something likethis
    going on. Please fix this soon. I would appreciate being informed of progresson
    this hole.
    mailfrom: ***
    mailsubject: Forums or Community
    thanks_url: /contact/thankyou.jsp
    category: sdn
    Time Stamp: Tue Oct 18 15:31:02 PDT 2005
    Contact Page Referer: http://forum.java.sun.com/forum.jspa?forumID=31
    Remote host : ***
    Remote IP address : ***
    Remote Agent : ***
    Script : http://developers.sun.com/jsp_utils/form_mailer.jsp
    Referring URL : ***
    ---

    Yes, the email visibility problem has been fixed.

  • T70 / tx9 touch screen visibility problems - patchy somewhat iridescent hazing

    I currently own a tx9 that has served me well for a year and a half.   in the past few months, the surface of the touch screen developed an iridescent patchy filmy look  that interferes with my ability to know if the picture I am about to take is in crystal clear focus, and as you might imagine, my photos have suffered as a result. the screen functions, and in certain lighting conditions (indirect mid morning light inside my house) I can mostly see what's going on, but generally, it is as though I am taking pictures mostly on faith, and do not know how the images look for certain from a clarity perspective until I upload them to my pc.  think of my problem as sort of an oil slick on water, but not swirly lore more like, peeling paint although nothing has peeled off that I am aware of)    is there anything at all that can help remedy this visibility problem or prevent it on future t series camera purchases? I have tried simply wiping it, using a lens cloth dampened with lens cleaner, and today just purchased a zagg screenprotector that I have yet not attempted to install as I ran across this forum.    i have for the most part kept my camera in a lined carrying case when not in use and in travels.  is it advisable to use a screen protector for the oled screen on the tx66? if so, what kind? ( I honestly would prefer to salvage my tx9 if possible and not shell  out the three hundred   plus dollars for the tx66, especially if this happens again in only two years..and I would hate to have to start looking at other brands.  my first Sony, the t70, also had similar problems and I willingly upgraded for the improvement in light sensitivity, but I really am ok with the tech in my tx9 otherwise ) .  

    There are MANY of us that have experienced the same issue.  This is NOT simply damage to the screen due to misuse, it is a failure of the anti-reflective coating.  We experienced this with a previous version of the Sony Cybershot and the store we purchased through advised us that the problem had been corrected on the new models.  As we have all found out, the touch screen on the Sony cameras has a serious durability issue and Sony has washed their hands of the problem.  We will not buy another sony camera again.  It's too bad, because the camera is really nice as a pocket camera and performs well otherwise.  Had we known that this was going to be an issue, we would have installed a protective film while it was new or simply chosen another camera.  We liked the simplicity of the touch screen but the failure of the anti reflective coating makes the screen almost unusable in areas where there is a lot of light.  The only solution that we have been able to find is to use a very fine polishing compound and remove the residual coating.  It means that the screen will have reflections but it will at least be more usable.  Toothpaste and a soft rag will remove the patchy areas of the coating that remains.  A touch sensitive screen should be a lot more durable than the one that Sony has been shipping. Sony has really done a disservice to their customers that have spent good money for a product that has a known failure problem.  What's worse is that they deny that there is an issue.  We all know better.

  • [svn] 3216: Fix for MXMLG-228, a visibility problem with graphic elements.

    Revision: 3216
    Author: [email protected]
    Date: 2008-09-15 18:13:11 -0700 (Mon, 15 Sep 2008)
    Log Message:
    Fix for MXMLG-228, a visibility problem with graphic elements. This is a quick fix that may force extra display objects when toggling visibility. We should investigate alternate solutions if performance is a problem.
    Bugs: MXMLG-228
    Reviewer: Deepa
    QA: Please check for performance problems when toggling visibility of a large number of graphic elements.
    Ticket Links:
    http://bugs.adobe.com/jira/browse/MXMLG-228
    http://bugs.adobe.com/jira/browse/MXMLG-228
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/graphicsClasses/GraphicElement .as

    Hello Antonio;
    After many, many test I discovered that the problem, at least in my case it is caused by the new ACR 4.5. Please read the Thread that I post under Camera Raw. I include the link below.
    I also open two Bug Reports about this, but as usual Adobe (and other Software Companies) will never take responsability for this, until one day they release a new version with "enhancements".
    PSE6 Organizer Crash with ACR 4.5 (Vista Only?)
    http://www.adobeforums.com/webx/.3bb6a869.59b60d3e

  • Data visibility problem in PDF file generated from R/3 system

    Hi all,
    We are converting the output of a Smartform into a PDF format. From this smart from, we receive data in OTF format, after which the required data is converted from OTF format to PDF format. Then PDF data is sent through mail using FM SO_NEW_DOCUMENT_ATT_SEND_API1 as an attachment. 
    For the above mentioned Smartform, we have defined Paragraph & Character font type as 'TIMES' in smart style. But when we receive the PDF file (through mail), some data of appears in other fonts:
    1) When PDF file is generated from Development system, the different font types which are used by PDF are Arial and Times-Roman. In this case, we are able to see the PDF output and faced no major problems because both of these fonts are supported by PDF file format.
    2) When PDF file is generated from Testing system, the font types which is used by PDF is Arial. In this case, we are able to see the PDF output because this font is supported by PDF file format.
    3) When PDF file is generated from Production system, the different font types which are used by PDF are Arial, Times-Roman and PBRS. Here, we are able to see the data which is displayed in Arial font and Times-Roman font. But we are not able to see the data which is displayed in PBRS font because this type of font is not supported by PDF file format. If we copy the distorted text from PDF file and paste it in MS-Word then the required data is clearly visible and that is due to the reason that MS-Word supports PBRS font.
    But as per smart style we have used only 'TIMES' font, then why different fonts are appearing in PDF file?
    What settings are required to be done to make this data visible?
    Any pointer to solve this issue will be really appreciable. Thanks in advance for your help.
    Thanks and Regards,
    Dheeraj Tolani

    Hi,
    check the following
    http://help.sap.com/bp_biv235/BI_EN/html/bw.htm
    business content
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/biw/g-i/how%20to%20co-pa%20extraction%203.0x
    https://websmp203.sap-ag.de/co
    http://help.sap.com/saphelp_nw04/helpdata/en/37/5fb13cd0500255e10000000a114084/frameset.htm
    (navigate with expand left nodes)
    also co-pa
    http://help.sap.com/saphelp_nw04/helpdata/en/53/c1143c26b8bc00e10000000a114084/frameset.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/fb07ab90-0201-0010-c489-d527d39cc0c6
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1910ab90-0201-0010-eea3-c4ac84080806
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/ff61152b-0301-0010-849f-839fec3771f3
    FI-CO 'Data Extraction -Line Item Level-FI-CO'
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/a7f2f294-0501-0010-11bb-80e0d67c3e4a
    FI-GL
    http://help.sap.com/saphelp_nw04/helpdata/en/c9/fe943b2bcbd11ee10000000a114084/frameset.htm
    http://help.sap.com/saphelp_470/helpdata/en/e1/8e51341a06084de10000009b38f83b/frameset.htm
    http://www.sapgenie.com/sapfunc/fi.htm
    Please reward for the same.

  • Jpopupmenu visibility problem with JWindows

    Hello,
    BACKGROUND:
    I am attempting to implement a feature similar to one found in the netbeans IDE for a programming editor I am helping to write. The feature is an autocomplete/function suggestion based on the current word being typed, and an api popup for the selected function.
    Currently a JPopupMenu is used to provide a list of suggested functions based on the current word being typed. EG, when a user types 'array_s' a JPopupMenu pops up with array_search, array_shift, array_slice, etc.
    When the user selects one of these options (using the up/down arrow keys) a JWindow (with a jscrollpane embedded in it) is made visible which displays the api page for that particular function.
    PROBLEM:
    The problem is that when a user scrolls down the JWindow the JPopupmenu disappears so he user cannot select another function.
    I have added a ComponentListener to the JPopupMenu so that when componentHidden is called I can do checks to see if it should be visible and make visible if necessary. However, componentHidden is never called.
    I have added a focuslistener to the JPopupMenu so that when it loses focus I can do the same checks/make visible if necessary. This function is never called.
    I have added a popupMenuListener but this tells me when it is going to make something invisible, not actually when it's done it, so I can't call popup.setVisible(true) from popupMenuWillBecomeInvisible because at that point the menu is still visible.
    Does anyone have any suggestions about how I can scroll through a scrollpane in a JWindow whilst still keeping the focus on a separate JPopupMenu in a separate frame?
    Cheers

    The usual way to do popup windows (such as autocomplete as you're doing) is not to create a JPopupMenu, but rather an undecorated (J)Window. Stick a JList in the popup window for the user to select their choice from. The problem with using a JPopupMenu is just what you're experiencing - they're designed to disappear when they lose focus. Using an undecorated JWindow, you can control when it appears/disappears.
    See this thread for information on how to do this:
    http://forum.java.sun.com/thread.jspa?threadID=5261850&messageID=10090206#10090206
    It refers you to another thread describing how to create the "popup's" JWindow so that it doesn't steal input focus from the underlying text component. Then, further down, it describes how you can forward keyboard actions from the underlying text component to the JWindow's contents. This is needed, for example, so the user can keep typing when the autocomplete window is displayed, or press the up/down arrow keys to select different items in the autocomplete window.
    It sounds complicated, but it really isn't. :)

  • XDK 9.0.2.0.C XSQL parameter visibility problem

    Dear Steven,
    I consider this as a serious bug:
    When one set XSQL page or XSQL session page parameter it
    become visible in page/request/session or otherwise only after
    the following round trip to the client.
    In other words, it is not present in the incoming XML to xslt to
    process.
    Thank you,
    David

    David,
    I just re-tested with 9.0.2C and things are working as they
    should. For example, the following XSQL page:
    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="test.xsl"?>
    <page xmlns:xsql="urn:oracle-xsql" connection="demo">
      <xsql:set-page-param name="page-param" value="1"/>
      <xsql:set-session-param name="sess-param" value="2"/>
      <xsql:set-stylesheet-param name="sheet-param" value="3"/>
      <xsql:include-param name="page-param"/>
      <xsql:include-param name="sess-param"/>
    </page>referencing the following stylesheet:
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:param name="sheet-param"/>
      <xsl:template match="/">
        <html><body>
        <b><xsl:value-of select="$sheet-param"/></b>
        <b><xsl:value-of select="/page/sess-param"/></b>
        <b><xsl:value-of select="/page/page-param"/></b>
        </body></html>
      </xsl:template>
    </xsl:stylesheet>shows an HTML page with the expected "321" the first request.
    If you are talking about cookies, then you are correct that the
    cookies you set this request are not visible until the next
    request (which is the standard way cookies work), however, you
    can use the new XSQL 9.0.2C feature to "see" the cookie value
    immediately by adding the immediate="yes"] attribute to
    your <xsql:set-cookie> action.
    If I've misunderstood your problem, please post a testcase that
    illustrates the issue. Thanks.

  • Developing new Swing Components - Visibility problems with UI classes

    I was wondering if anyone out there had run into the following problems when developing new Swing components. If so it might be worth banding together and putting pressure on Sun to fix them. However, if no one else develops new Swing components then I guess I'm just a lone voice...
    I have been writing a new dockable toolpanel Swing component and when it came to implementing the UI manager I was unable to access many of the standard features in basic and metal LAFs because they had been made package protected. This forced me to reimplement quite a bit of existing code which took time as well as being bad practice.
    While in some cases I can understand this from a security POV I am pretty sure that in this case it is the result of lazy programming practice. Appart from basic architectural reasons for this I have noticed a trend where newer code seems to suffer from this more than the original code. The practice of using package protection reminds me of C++ style coding, or just that of an inexperienced developer who does not understand the need to code for extensibility.
    An additional problem arises because the Security manager stops you cheating the system by putting new classes into the javax.swing.plaf... package structure. Thus the only way to solve this nicely is a proper fix.
    This would entail going through all the UI PLAF classes and rationalizing the visibility to either public or protected as appropriate. Really there should be minimal use of package protection unless it is vital for security concerns.
    Some Examples (there are many more):
    javax.swing.plaf.basic.LazyActionMap
    javax.swing.plaf.basic.BasicBorders.RolloverMarginBorder
    javax.swing.plaf.basic.BasicBorders.SplitPaneDividerBorder (why are just these two classes package protected when all the others are public?)
    javax.swing.plaf.metal.MetalUtils
    javax.swing.plaf.metal.MetalBumps
    Anyway, I am happy to give advice to other poor saps who wind up fighting the UI manager but it would be better if we could get Sun to sort out this mess (after all they created it).
    Cheers, Lewis

    It may be more a case of creating new Swing components and trying to provide support for all the standard LnFs.
    This is very awkward although you can sometimes achieve what you want by borrowing resources from UIManager (a border here, an icon there etc.).
    Essentially the problem is that Swing is designed to have new components added to it but the standard LnFs aren't quite so accommodating!

  • JCombobox selection problem

    Hello,
    I have some problem implementing events associated with JComboBox. My requirement is "the event should get fired only when an item is selected in the combobox". It may occur thet using arrow keys I can traverse all elements in the combobox and on item change the event should not get fired. I tried with itemstatechanged, actionperformed but no result.
    Any help will be appreciated.
    regards,
    Ranjan

    A simple working example:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.text.*;
    public class ComboBoxAction extends JFrame implements ActionListener
         private JComboBox comboBox;
         public ComboBoxAction()
              comboBox = new JComboBox();
              comboBox.addActionListener( this );
              comboBox.addItem( "Item 1" );
              comboBox.addItem( "Item 2" );
              comboBox.addItem( "Item 3" );
              comboBox.addItem( "Item 4" );
              //  This prevents action events from being fired when the
              //  up/down arrow keys are used on the dropdown menu
              comboBox.putClientProperty("JComboBox.isTableCellEditor", Boolean.TRUE);
              getContentPane().add( comboBox );
         public void actionPerformed(ActionEvent e)
              System.out.println( comboBox.getSelectedItem() );
              //  make sure popup is closed when 'isTableCellEditor' is used
              comboBox.hidePopup();
         public static void main(String[] args)
              JFrame frame = new ComboBoxAction();
              frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
              frame.pack();
              frame.setVisible( true );
    }

  • Photoshop CS4 Pen Tool Visibility Problem

    I recently upgraded to CS4 and started using Photoshop to do some work. Working on some clipping path with the pen tool I've come to notice how incredibly light the pen tool outline is. I cant see where or what im tracing cause I can't tell where the line is unlike the other earlier creative suites where the line was visible.
    Anyone have any ideas on making this outline more visible so I can actually see what I am doing. Input would be much appreciated.

    I am having the exact same problem with Photoshop CS 4 on my MacBook OSX 10.5.7 4 GB RAM    Intel GMA X3100:  graphics card
    When I enable Open GL in PS CS4 preferences, the pen tool line is too light, too thin to use and the anchor points aren't accurate , I have to disable Open GL to get the normal pen function back. Adobe should get us a fix to make Open GL compatable with all graphics cards. All functions in Open GL work fine except the Pen Tool.

  • JcomboBox + FOR - problem

    Hi,
    I try changing this code:
    ArrayList<String> tmp = new ArrayList<String>();
    tmp.add(numbertext.getText());
    for(String temp1 : tmp)
    System.out.println("a="+temp1.toString());
    <b>
    Legend:
    </b>
    numbertext is a JtextField.for JComboBox using FOR but i have error and problems.
    String[] items = {"item1", "item2", "item3"};
    jComboBox1.setModel(new DefaultComboBoxModel(items));
    int num = jComboBox1.getItemCount();
    String my = Integer.toString(num);
    for (String s : my ) {
            Object item = jComboBox1.getItemAt(num);
            System.out.println("a="+s.toString());I don;t know how to translate for JComoboBox.
    Please help

    Hmmmm,
    I try creating code which I choose in JComoboBox1 value for example Items2 and I click the button. My first value Items2 will be include in string, next I choose value items 4 in JcomboBox and the second value will be in string. Now In string I have a 2 value: items 2 and items 4 And I will have doing choose new value to infinity.
    I don't now how to create.

  • JComboBox listener problem

    Hi all,
    I have following problem, i use combobox and i need to write listener for selecting item.
    But both ActionListener and ItemListener are unusable for me, because i dont know how to differ between selecting item when combobox is poped up.
    I dont want to react on going thru items in popup, but only to FINAL select of button.
    Please Help.
    Mathew, HSIGP

         This works on non editable combo boxes
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.text.*;
    public class ComboBoxAction extends JFrame implements ActionListener
         JComboBox comboBox;
         public ComboBoxAction()
              comboBox = new JComboBox();
              comboBox.addActionListener( this );
              comboBox.addItem( "Item 1" );
              comboBox.addItem( "Item 2" );
              comboBox.addItem( "Item 3" );
              comboBox.addItem( "Item 4" );
              //  This prevents action events from being fired when the
              //  up/down arrow keys are used on the dropdown menu
              comboBox.putClientProperty("JComboBox.isTableCellEditor", Boolean.TRUE);
              getContentPane().add( comboBox );
         public void actionPerformed(ActionEvent e)
              System.out.println( comboBox.getSelectedItem() );
              //  make sure popup is closed when 'isTableCellEditor' is used
              comboBox.hidePopup();
         public static void main(String[] args)
              final ComboBoxAction frame = new ComboBoxAction();
              frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
              frame.pack();
              frame.setVisible( true );
    }

  • JComboBox Render Problem........

    Hi I have a problem in JCombox renderer in my application Problem is i have Three comboBox columns in my table wing same Renderer and Editor. second and third combo column's aree working fine But in first combo-column if i add a new row clicking add button and if change a value in top- most comboBox i will reflect in all ComboBox's below, this is not happening in othe two Combo-column. i'am not at all gettin why this happens where i am using same renderer for all combo-columns how to stop this, When a new row is add ComboBox first item as Selected,
    Can any one please tell me how to solve this,
    since i cannot past entair application i am pasting example with similar suituation using same renderer.
    Thank's in Advance
    CODE:-
    import java.awt.BorderLayout;
    import java.awt.Component;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.DefaultCellEditor;
    import javax.swing.JButton;
    import javax.swing.JComboBox;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.table.DefaultTableModel;
    import javax.swing.table.TableCellRenderer;
    import javax.swing.table.TableColumn;
    * @author 501376972
    public class MainTable extends JFrame{
    DefaultTableModel model = null;
    JTable table = null;
    JScrollPane scrollpane = null;
    JButton btCancel = null;
    JButton btADD = null;
    JPanel panelButton = null;
    public Object[][] data = null;
    String column[] = {" ","A","B","C","D","E","F"};
    String oprator[] = {" ","=","/","*","-","+"};
    String number[] = {" ","1","2","3","4","5","6"};
    /** Creates a new instance of MainTable */
    public MainTable() {
    model = new DefaultTableModel();
    model.addColumn("Column");
    model.addColumn("Operator");
    model.addColumn("Value");
    model.addColumn("Number");
    table = new JTable();
    table.setModel(model);
    data = new Object[][]{
    {column, oprator, null, number}
    model.addRow(data);
    TableColumn colCol = table.getColumnModel().getColumn(0);
    colCol.setCellRenderer(new ComboBoxCellRenderer(column));
    colCol.setCellEditor(new ComboBoxCellEditor(column));
    TableColumn colOpr = table.getColumnModel().getColumn(1);
    colOpr.setCellRenderer(new ComboBoxCellRenderer(oprator));
    colOpr.setCellEditor(new ComboBoxCellEditor(oprator));
    TableColumn colLog = table.getColumnModel().getColumn(3);
    colLog.setCellRenderer(new ComboBoxCellRenderer(number));
    colLog.setCellEditor(new ComboBoxCellEditor(number));
    scrollpane = new JScrollPane(table);
    getContentPane().setLayout(new BorderLayout());
    getContentPane().add(scrollpane,BorderLayout.CENTER);
    panelButton = new JPanel();
    btADD = new JButton("ADD");
    btCancel = new JButton("Cancel");
    panelButton.add(btADD);
    panelButton.add(btCancel);
    getContentPane().add(panelButton,BorderLayout.SOUTH);
    btCancel.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent e) {
    dispose();
    btADD.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent e) {
    model.addRow(data);
    getContentPane().add(scrollpane);
    setSize(500,500);
    class ComboBoxCellRenderer extends JComboBox implements TableCellRenderer {
    public ComboBoxCellRenderer(String[] items) {
    super(items);
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
    if (isSelected) {
    //DO NOTHIING
    } else {
    //DO NOTHIING
    // Select the current value
    if(value == null)
    setSelectedIndex(0);
    else
    setSelectedItem(value);
    return this;
    public class ComboBoxCellEditor extends DefaultCellEditor {
    public ComboBoxCellEditor(String[] items) {
    super(new JComboBox(items));
    * @param args the command line arguments
    public static void main(String[] args) {
    MainTable mt = new MainTable();
    mt.setVisible(true);
    }

    Don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the posted code retains its original formatting.
    Don't know why the code works the way it does, but the code is wrong. The correct way to add a row is like this:
    //model.addRow(data);
    String[] rowData = { " ", " ", " ", " "};
    model.addRow(rowData);

  • JComboBox addActionListener problem?

    HI,
    i am using JComboBox to add each item action perform of use StyleEditorKit.FontSizeAction("String", int), but i only can add one item action perform only. See my code any problem...
    for(int i>12;i<=50 ; i++){
                  comboBox.addItem(" "+i);
               // i want to loop each item can function
                comboBox.addActionListener(new StyleEditorKit.FontSizeAcion("i ", i)Thanks

    FontSizeAction is able to set the size to a value delivered in String format as the command String of its ActionEvent. Unfortunately, the JComboBox doesn't deliver the String value of the selected item as command string but an arbitrary value to be set once. So you have to wrap your FontSizeAction in a custom ActionListener of your own where you retrieve the selected item, cast it to a String and pass this value to FontSizeAction as the command String of a new ActionEvent object.
    You should also get rid of that whitespace when creating the size value, String.valueOf(int) is a better way to create a String for an int.

  • JComboBox Dropping Problem

    Hi, I have a JComboBox in a table cell with all the Item I need. But the problem is when I click on JComboBox, dropdown menu pops up and immediately hides automatically. And cannot allow me to choose anything.
    Any suggestions plz.
    Thanks

    You've got a coding problem, so read this section from the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/combobox.html]How to Use Combo Boxes for example on how to do this correctly.

Maybe you are looking for

  • I upgraded to Lion, Excel won't open, and what is "Solver" found in the "Launchpad"?

    I upgraded to Lion last night, I have Mac OX X 10.7.1 and all other Microsoft Office products (Word & PowerPoint) work just fine, but within the "Launchpad" of Lion, there is an icon called "Solver).  When I click on it, the Excel - icon opens up but

  • JBOSS jndi Datasource: jdbc not bound

    Im adding an jndi Datasource to JBOSS 4.0.2. 1. i copied jdbc driver to JBOSS_HOME/server/default/lib. 2. i copied following ds.xml to JBOSS_HOME/server/default/deploy (its based ony the mysql-ds.xml from the samples) <?xml version="1.0" encoding="UT

  • Calendar publishing host does not update automatically

    GroupWise 2014 is installed on OES11 SP2 with web access and calendar publishing host in virtual vmware environment. The calendar will not automatically update existing or display newly published users' calendars until I manually enter rcnovell-tomca

  • Complex rate calculations

    A bit of background (especially for anyone not in the UK). Here people are registered with their local doctor's practice. The practices are grouped into consortia. There are several consortia with the city. I'm looking at hospital referrals. The refe

  • Games won't load due to "Need to upgrade flash player" which should be updated already in chrome

    My flash player is 11.7.700.203  Adobe says it should be 11.7.700.225  Chrome is supposed to update automatically and when i try to play games like candy crush is won't load and says I need to grade my flash player. I need help bad.