Swing components not visible

Hello,
My big and ununderstandable problem is that i have developed my application under eclipse IDE and it works perfectly well, the application has A JTabbedPane with 6 Tabs consisting of a JEditPane first 5 and the last one consisting of a JSplitPane, which inside it�s got another JSplitPane which inside has a JScrollPane wrapping a Jtable.
This works marvelous on my development station, but when i export it to a Jar file and execute it on another machine, all the first 5 tabs are displayed perfectly when i click on them. But the last one doesn�t, if i roll over the places and click i can obtain the functionality but can�t see well most of the swing components.
Thank you very much in advance for your attention.

In the absence of code I can only guess. Here's my first guess. You used a Panel instead of a JPanel for the tab.

Similar Messages

  • Swing components not displaying correctly in JApplet

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

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

  • Application Components not visible in SAP R/3 tree

    Dear All,
    We have standalone system and we have installed ECC 6.0 with BI Content. Harddisk is 320 GB with 2 GB RAM. We want to extract the data from R/3 to BW which are on the same system (As ECC 6.0 contains builtin BW).
    In RSA1 the application components are not visible in the SAP R/3 tree under datasource tab. When I am replicating the entire SAP data source it is giving shortdump(STORAGE_PARAMETERS_WRONG_SET).
    How can I replicate a particular data source to avoid the memory problems because I have only 2 GB RAM.

    You can also Replicate a single datasource w/o replicating the  App Comp using a FM.
    BW
    SE37
    RSAOS_METADATA_UPLOAD
    Execute
    Give Source System n Datasource - Execute
    *Give Datasource Name - for I_O... & Source System for Logsys.

  • Swing Components not displaying in a JFrame

    Hi,
    I have a JFrame with a couple of JLabels, JButtons etc. and a Choice Combo Box
    my problem is that when i run the program the only component that gets displayed at first is Choice and in order for me to see the swing components i have to roll over them with my mouse and the JLabels dont even display when i do that..
    Does anyone know how i can fix this please?
    here is my code
    import java.awt.*;
    import java.awt.event.*;
    import java.lang.*;
    import java.awt.Image.*;
    import java.io.*;
    import java.net.*;
    public class ImageViewerAnim extends JFrame {
         private JLabel perc, scale;
         private JTextField inPercent;
         private JButton draw, muteOn;
         private JPanel sPanel;
         private String[] pics = {"Earth", "Moon", "Jupiter", "Pluton", "Neptun"};
         private String[] picsFile = {"images/earth.gif", "images/moon.gif", "images/jupiter.jpg", "images/pluton.jpg", "images/neptun.jpg"};
         private String[] soundsFile = {"sounds/tada.wav", "sounds/notify.wav", "sounds/ding.wav", "sounds/chimes.wav", "sounds/chimes.wav"};
         private Choice ch;
         private Image pic;
         private AudioClip sound = null;
         private int scaleAm = 0;
         private int origScale = 500;
         private int finalScale = 0;
         private boolean proceed = true;
         public ImageViewerAnim() {
              Container c = getContentPane();
              c.setLayout(new BorderLayout());
              sPanel = new JPanel();
              ch = new Choice();
              for(int i = 0; i < pics.length; ++i) {
                   ch.add(pics);
              scale = new JLabel("Scale");
              perc = new JLabel("%");
              inPercent = new JTextField(5); // scale value input field
              draw = new JButton("Draw");
              draw.setBorder(BorderFactory.createEtchedBorder());
              draw.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        int index = 0;
                        index = ch.getSelectedIndex();
                        pic = null;
                        repaint();
                        pic = (Toolkit.getDefaultToolkit().getImage(picsFile[index]));
                        try{
                        File f = new File(soundsFile[index]);
                        sound = Applet.newAudioClip(f.toURL());
                        }catch(MalformedURLException mfe) {
                             mfe.printStackTrace();
                        if(!inPercent.getText().equals("")) {
                             scaleAm = Integer.parseInt(inPercent.getText()); // get the scale amount from the user
                             finalScale = ((origScale * scaleAm)/100); // calculate the final scale amount based on what the user entered
                        }else {
                             finalScale = origScale; // default to original size of the image if no value for scale was entered
                        // creates a scaled instance of an image and takes the amount of scale as an argument
                        repaint();
                        sound.loop();
              muteOn = new JButton("Mute On");
              muteOn.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        sound.stop();
                        muteOn.setText("MuteOff");
              sPanel.add(ch);
              sPanel.add(scale);
              sPanel.add(inPercent);
              sPanel.add(perc);
              sPanel.add(draw);
              sPanel.add(muteOn);
              c.add(sPanel, BorderLayout.SOUTH);
              repaint();
    public void paint(Graphics g) {
         if(pic!=null) {
              g.drawImage(pic,0,0,this);
    public static void main(String args[]) {
         ImageViewerAnim app = new ImageViewerAnim();
         app.setSize(500,500);
         app.setVisible(true);
         app.setDefaultCloseOperation(EXIT_ON_CLOSE);
         app.show();
    thank you in advance
    Ivo

    for future reference
    i was able to fix this by adding
    super.paint(g);in the first line of my paint method
    Ivo

  • Swing/bc4j - not visible gif stored in blob thru forms

    I have problem with displaying gifs stored in blob column through Forms. If the very same files are stored through swing client they are visible in both swing and forms application.
    In thread Displaying jpeg in JSP I saw that the reason for irregular blob behaviour could be its "forms background". What is exactly problem?
    Is it possible to update blob column in database somehow (reloading over 2000 gifs will be pretty uncomfortable and slow) ?
    I am using JDev 9.0.5.1 build 1605, DB 8.1.7., Forms 6i.

    It appears that Forms, while storing gifs, uses compression apparently not handled by JUImageControl. More on Metalink 16035040.6

  • Custom Components not Visible in the Flex Design

    Hi
        I am trying to create a Flex Application to consume a Web service.
         Which DataGrid can i use to get the list of data at runtime.
         The Datagrid component which is available  under Controls in the design is displaying 3 columns and 3 rows by default. But if i use this UI element no.rows and coulmns cannot be changed at runtime.
    So could anybody advice me which datagrid can be used?
    By defalult Flex design has Controls, Layout, Navigators, Charts components
    Could anybody tell me whats Custom Component in the design. becoz i cannot see any of the components under Custom folder.
    Is it a custom developed one or is it a Default like other components ?
    How do I get these components  Customer DataGrid, Video Chat, Yahoo Search, Countries By Group etc.
    Please guide me...
    Thanks & Regards
    Sireesha.
    Edited by: sireesha esukapalli on Dec 1, 2008 1:06 PM
    Edited by: sireesha esukapalli on Dec 1, 2008 1:17 PM

    Hi Daniel,
        Could you please check the below code in MXML.
        I am getting the error as Unexpected paramater "CustomerNo" not found in input arguments.
       What node should be given under <request> tag ? Is it can be any xml node related to customer no? or anyother thing?
        <mx:WebService id="WSCust"
         wsdl="http://ctsintcosnw4.cts.com:8000/sap/bc/srt/rfc/sap/zws_custinfo?sap-client=812&wsdl=1.1 "
        showBusyCursor="true"
         fault="Alert.show(event.fault.faultString)"
         result="onCustResult(event)"
              >
    <mx:operation name="ZBAPI_CUSTOMER_DETAIL2">
         <mx:request>
         <CustomerNo>
              {Cust_no.text}
         </CustomerNo>     
         </mx:request>
    </mx:operation>
    </mx:WebService>
    <mx:Script>
         <![CDATA[
    private function Getcust_data():void
    WSCust.getOperation("ZBAPI_CUSTOMER_DETAIL2").send();
         ]]>
    </mx:Script>
    <mx:Label  text="CustomerNo"  id="lblcustno" />
         <mx:TextInput id="Cust_no" />
    <mx:Button  id="btn_custno" label="Display Customer General Data" click="Getcust_data()" />
    Regards
    Sireesha.

  • SP-Status of Software components not visible in Maintenance Optimizer

    Hi
    1.     I have created a Server, Database, Systems for an Nw2004s Enterprise Portal server. That is the main relevant component is Enterprise portal
    2.     Then I assign the system to the logical component  as a production system to the SAP Netweaver Portal Server(System Groups and Logical components-> Logical components-> SAP Netweaver-> Enterprise Portal-> SAP Netweaver Portal Server
    3.     Then I added the same logical component to Solution created earlier in Solution landscape(System Groups and Logical components->Solution Landscape->MySolution
    4.     This listed my EP system in MySolution->Operation->Change Management->Support Package stack
    5.     I could able to see the System name and its Product version
    But I am not able to see SP-Status of Software components when I expand the node.
    It seems that Solution Manager was not able to read the software component data from the from my remote Enterprise Portal server. It was not in sync with Remote portal server. I tried to use SMSY_SETUP (Automatic DataTransfer) using both TMS/RFC and SLD. But there is no result
    Can any body tell me how to make remote server sync with Solman?
    Regards
    Arati

    Hello Arati,
    In transaction RZ70 do you have the Solution Manager correctly defined as host/service for SLD bridge ? Also schedule job here, start data collecting and don't forget to activate current configuration. Also check transaction sldapicust in remote server is setup correctly and run trans sldcheck to test if everything is working.
    Regards,
    Nelis

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

  • Swing components in applet not working in web browser

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

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

  • Components are not visible in personalization

    Hi,
    In iSupplier Portal, some page components are not visible for buyer address book. (Stack Layout: addressCreateUpdateStack) I even tried to change context, they are still not visible. How I can solve this issue?
    Btw, the personalizations are just enable for a standart user. Can this cause the problem?
    Edited by: user8627992 on 07.Oca.2011 03:38
    Edited by: user8627992 on 07.Oca.2011 03:56

    Try
    begin
    jdr_utils.listcustomizations(FullPathOfPage);
    end;
    this will give you all the customizations made to the page
    for each line returned
    try
    begin
    jdr_utils.printDocument(<linereturnedFromAboveProcedure>);
    end;
    Regards
    Ravi

  • Not getting swing components when the applet reloads

    I am facing one problem that is related to reloading of swing components. I Have a JPanel inside JApplet which contains some swing components and a button to launch the same JPanel again in the JApplet. When I click on the button the JPanel should get added in the JApplet once again below the upper JPanel. But new JPanel is not getting displayed although the reference of the new JPanel is created.

    My guess is that you haven't added your swing components to the right place. Are you adding them to the contentpane?

  • Image components are not visible.

    Hi Experts,
    Some time back i created a dashboard based on XML connectivity with around 59 components in it. Some of them are not visible on the canvas (I did checked the object browser) and few of the image components are even not visible in the preview mode.
    I am quite new in Dash boarding.
    kindly suggest me way to make it work as earlier.
    Thanks!

    We faced the same issue during early development phases. You need to install the fix pack to correct this issue. Remember fix pack will make sure this wont happen again but it wont make the disappeared component to appear.
    3.5 is the latest patch available you can install anything above 3.1 (we are using 3.3).
    let us know if you still have any issue regarding this.

  • Components are not visible in the beginning..

    Hai ..
    The contents(TextFields Labels and Buttons) of my application are displayed only after i resize the frame manually.. Why is it so.. Is there any way to make them visible as soon as i run the application..
    This happens only for the first time(ie immediately after running the application..).. I guess its because of the Focus not being given to the Frame in the beginning(I may be wrong.. Correct me if i am wrong).. Any one with any solution??
    Thanks in advance!!

    /* This program is meant for opening the internet explorer on typing the search text in the TextField and pressing enter*/
    public Search()
    f=new Frame();
    maxwidth=Toolkit.getDefaultToolkit().getScreenSize().width;
    maxheight=Toolkit.getDefaultToolkit().getScreenSize().height;
    f.setBounds(maxwidth-200,0,200,maxheight);
    f.setVisible(true);
    f.setLayout(null);
    f.setBackground(Color.BLACK);
    f.setForeground(Color.RED);
    st=new JTextField();
    sl=new JLabel("Search");
    sl.setBounds(25,525,150,25);
    st.setBounds(25,565,150,25);
    sl.setForeground(Color.RED);
    f.add(sl);f.add(st);
    /* On pressing Enter i try to convert the contents in the textbox in a search string to be used in google*/
    st.addKeyListener(new KeyAdapter()
    public void keyPressed(KeyEvent ke)
    if(ke.getKeyCode()==KeyEvent.VK_ENTER)
    searchstring=st.getText();
    char ss[]=searchstring.toCharArray();
    for(int i=0;i<ss.length;i++)
    if(ss==' ')
    ss[i]='+';
    searchstring=new String(ss);
    try
    p=Runtime.getRuntime().exec("C:\\Program Files\\Internet Explorer\\iexplore.exe www.google.co.in/search?hl=en&q="++searchstring++"&meta=");
    catch(Exception e1)
    System.out.println("Internet Explorer not found in C drive");
    try
    p=Runtime.getRuntime().exec("E:\\Program Files\\Internet Explorer\\iexplore.exe www.google.co.in/search?hl=en&q=+"+searchstring++"&meta=");
    catch(Exception e2)
    System.out.println("Internet Explorer not found in E drive");
    f.addWindowListener(new WindowAdapter()
    public void windowClosing(WindowEvent we)
    f.setVisible(false);
    /* This imgpanel is used to display an image in the JPanel*/
    imgpanel=new JPanel();
    imgpanel.setLayout(new GridLayout(1,1));
    f.add(imgpanel);
    imgpanel.setBounds(25,50,150,150);
    img=Toolkit.getDefaultToolkit().getImage("sample.jpg");
    img=img.getScaledInstance(150,150,Image.SCALE_SMOOTH);
    imgicon=new ImageIcon(img);
    imglabel=new JLabel(imgicon);
    imglabel.setVisible(false);
    imgpanel.add(imglabel);
    On executin the code i get the frame visible .. The JPanel is also visible but the image is not present.. Its visible once I resize the frame.. Also the TextField(for getting the search text)and the associated JLabels are sometimes not visible.. They are visible only if i bring some other window in front of it or if i resize the Frame..
    Thanks!!
    Edited by: s.baalajee on Jan 7, 2009 9:44 AM
    Edited by: s.baalajee on Jan 7, 2009 9:45 AM

  • I'd like to make a list of interactive Swing components....

    EDIT: I've been doing more research about Layout Managers and it appears that BoxLayout may provide me with the solution I need. I'll mess around with it for awhile and report back if I still need help. Thanks pals!+
    I would like to make a list of JPanels laid out in basically a column. One on top of the other. That's not so difficult, but I need to make it able able to add and remove panels in response to user-driven events (in other words, I can't just hard-code them all, and the panels are generated on the fly, so I don't even know how many I'll need to be displaying until I need to display them.
    Here's a simple mockup of the window I'm talking about.
    |      - o x |
    |____________|
    |            |
    |            |
    |   Panel1   |
    |   Panel2   |
    |   Panel3   |
    |   Panel4   |
    |____________|At first, I thought a JList would serve my purpose, but you can't add interactive Swing components to JLists (or JTables)... they'll render, but that's all. My panels will contain a button and a checkbox, so this is a no-go.
    I was also thinking I could just manage the placement with GridBagLayout and just keep indexes for the current y position, but if there's an easier way, I'd rather not go this route. It has me writing a lot of extra code and manipulating a lot of fields of GridBagConstraints, which opens me to less-understandable code and more error-prone code, on account of I'm great at making little mistakes when I'm setting craploads of constraints.
    Does anyone have any ideas? It'd be ideal if there was just some sort of container I could plop them in with add and remove methods (a la JTabbedPane or something).
    I'm pretty new to Swing, so maybe I'm missing something obvious.
    Edited by: Caryy on Sep 30, 2010 4:15 PM

    I would recommend using BoxLayout or Box.createVerticalBox(). As mKorbel already mentioned, you need to call revalidate() after adding any component to an already realized/visible container, and additionally call repaint() after removing a component. To resize the top level window to accommodate its new content, you would call pack(). Or, again as suggested by mKorbel, wrap your panel/Box in a JScrollPane.
    db

  • JComboBox is not visible on JPanel

    I have a class that extends JPanel. Within this class I have added several different components; JLabels, JTextFields, JButtons and a JComboBox.
    All of the added components are visible and working except for the JComboBox. I can see the white background of the box and the popup and its list when I click on the area where the JComboBox is located, but I cannot see the selected text in the box. This seems strange since all the other components surrounding the JComboBox display correctly.
    The background is set to white and the foreground is set to black. It has three options in the popup which are displayed using the foreground color, as it should. When I select an option from the popup, it seems to be working because the next time I display the popup, that selection is highlighted. But the selected text never shows in the box.
    If I create a JComboBox in a JPanel, not an extended class, everything seems to work correctly. I can select from the popup and the selection appears in the box.
    Could you please give me some suggestions as to how to make the selected text in the JComboBox visible?
    Thanks
    Bob

    My layout manager is set to null. I don't think that there is anything obscuring it because the backgroud is visible. The only thing that I can't see it the selected text and the combo box down arrow. I am using VisualCafe to generate this code.
    The extended class is loaded from the following class:
    public class TheSchedule extends javax.swing.JFrame
    using the following code:
         void JButtonGenTimeUnits_actionPerformed(java.awt.event.ActionEvent event)
              JPanelMainPanel.add(new TimeUnitDefinition((Frame)this));
              JPanelMainPanel.repaint();
    The actual code of the TimeUnitDefinition is as follows:
    package com.klawuhn.schedule;
    import javax.swing.*;
    import java.beans.*;
    import java.awt.*;
    import com.symantec.itools.javax.swing.models.StringComboBoxModel;
    import symantec.itools.awt.util.Calendar;
    import com.symantec.itools.javax.swing.borders.LineBorder;
    public class TimeUnitDefinition extends javax.swing.JPanel {
    private Frame parentFrame = null;
         public TimeUnitDefinition(Frame parentFrame)
         this.parentFrame = parentFrame; // Needed when displaying the calendars
              //{{INIT_CONTROLS
              setAlignmentY(1.0F);
              setAlignmentX(1.0F);
              setOpaque(false);
              setLayout(null);
              setSize(457,283);
              JLabelStartDate.setText("Start Date:");
              add(JLabelStartDate);
              JLabelStartDate.setBounds(12,12,156,24);
              JTextFieldStartDate.setDisabledTextColor(java.awt.Color.white);
              JTextFieldStartDate.setToolTipText("This is the date to start generating time units.");
              JTextFieldStartDate.setEditable(false);
              add(JTextFieldStartDate);
              JTextFieldStartDate.setBackground(java.awt.Color.white);
              JTextFieldStartDate.setBounds(168,12,216,24);
              JButtonCalendar1.setText("-");
              JButtonCalendar1.setActionCommand("-");
              add(JButtonCalendar1);
              JButtonCalendar1.setBounds(384,12,24,24);
              JLabelEndDate.setText("End Date:");
              add(JLabelEndDate);
              JLabelEndDate.setBackground(java.awt.Color.cyan);
              JLabelEndDate.setBounds(12,48,156,24);
              JTextFieldEndDate.setDisabledTextColor(java.awt.Color.white);
              JTextFieldEndDate.setToolTipText("This is the date to start generating time units.");
              JTextFieldEndDate.setEditable(false);
              add(JTextFieldEndDate);
              JTextFieldEndDate.setBackground(java.awt.Color.white);
              JTextFieldEndDate.setBounds(168,48,216,24);
              JButtonCalendar2.setText("-");
              JButtonCalendar2.setActionCommand("-");
              add(JButtonCalendar2);
              JButtonCalendar2.setBounds(384,48,24,24);
              JLabelStartTime.setText("Start Time:");
              add(JLabelStartTime);
              JLabelStartTime.setBounds(12,84,156,24);
              JTextFieldStartTime.setToolTipText("This is the time of day to start generating time units.");
              add(JTextFieldStartTime);
              JTextFieldStartTime.setBounds(168,84,240,24);
              JLabelEndTime.setText("End Time:");
              add(JLabelEndTime);
              JLabelEndTime.setBounds(12,120,156,24);
              JTextFieldEndTime.setToolTipText("This is the time of day to end generating time units.");
              add(JTextFieldEndTime);
              JTextFieldEndTime.setBounds(168,120,240,24);
              JLabelUnitOfMeasure.setText("Unit of Measure:");
              add(JLabelUnitOfMeasure);
              JLabelUnitOfMeasure.setBounds(12,156,156,24);
              JComboBoxUnitOfMeasure.setModel(stringComboBoxModel1);
              JComboBoxUnitOfMeasure.setToolTipText("This is the unit of measure used when generating the time units.");
              add(JComboBoxUnitOfMeasure);
              JComboBoxUnitOfMeasure.setBackground(java.awt.Color.white);
              JComboBoxUnitOfMeasure.setForeground(java.awt.Color.black);
              JComboBoxUnitOfMeasure.setBounds(168,156,240,24);
              JLabelBlockSize.setText("Block Size:");
              add(JLabelBlockSize);
              JLabelBlockSize.setBounds(12,192,156,24);
              JTextFieldBlockSize.setText("45");
              JTextFieldBlockSize.setToolTipText("This is the size of the time unit in Unit of Measures.");
              add(JTextFieldBlockSize);
              JTextFieldBlockSize.setBounds(168,192,240,24);
              JButtonSubmit.setText("Submit");
              JButtonSubmit.setActionCommand("Submit");
              JButtonSubmit.setToolTipText("This button will generate the time units.");
              add(JButtonSubmit);
              JButtonSubmit.setBounds(36,228,108,40);
              JButtonCancel.setText("Cancel");
              JButtonCancel.setActionCommand("Cancel");
              JButtonCancel.setToolTipText("This button will discard any changes.");
              add(JButtonCancel);
              JButtonCancel.setBounds(288,228,108,40);
                   String[] tempString = new String[3];
                   tempString[0] = "Days";
                   tempString[1] = "Hours";
                   tempString[2] = "Minutes";
                   stringComboBoxModel1.setItems(tempString);
              //$$ stringComboBoxModel1.move(0,288);
              JComboBoxUnitOfMeasure.setSelectedIndex(2);
              //{{REGISTER_LISTENERS
              SymAction lSymAction = new SymAction();
              JButtonSubmit.addActionListener(lSymAction);
              JButtonCalendar1.addActionListener(lSymAction);
              JButtonCalendar2.addActionListener(lSymAction);
         //{{DECLARE_CONTROLS
         javax.swing.JLabel JLabelStartDate = new javax.swing.JLabel();
         javax.swing.JTextField JTextFieldStartDate = new javax.swing.JTextField();
         javax.swing.JButton JButtonCalendar1 = new javax.swing.JButton();
         javax.swing.JLabel JLabelEndDate = new javax.swing.JLabel();
         javax.swing.JTextField JTextFieldEndDate = new javax.swing.JTextField();
         javax.swing.JButton JButtonCalendar2 = new javax.swing.JButton();
         javax.swing.JLabel JLabelStartTime = new javax.swing.JLabel();
         javax.swing.JTextField JTextFieldStartTime = new javax.swing.JTextField();
         javax.swing.JLabel JLabelEndTime = new javax.swing.JLabel();
         javax.swing.JTextField JTextFieldEndTime = new javax.swing.JTextField();
         javax.swing.JLabel JLabelUnitOfMeasure = new javax.swing.JLabel();
         javax.swing.JComboBox JComboBoxUnitOfMeasure = new javax.swing.JComboBox();
         javax.swing.JLabel JLabelBlockSize = new javax.swing.JLabel();
         javax.swing.JTextField JTextFieldBlockSize = new javax.swing.JTextField();
         javax.swing.JButton JButtonSubmit = new javax.swing.JButton();
         javax.swing.JButton JButtonCancel = new javax.swing.JButton();
         com.symantec.itools.javax.swing.models.StringComboBoxModel stringComboBoxModel1 = new com.symantec.itools.javax.swing.models.StringComboBoxModel();
         class SymAction implements java.awt.event.ActionListener
              public void actionPerformed(java.awt.event.ActionEvent event)
                   Object object = event.getSource();
                   if (object == JButtonSubmit)
                        JButtonSubmit_actionPerformed(event);
                   else if (object == JButtonCalendar1)
                        JButtonCalendar1_actionPerformed(event);
                   else if (object == JButtonCalendar2)
                        JButtonCalendar2_actionPerformed(event);
         void JButtonSubmit_actionPerformed(java.awt.event.ActionEvent event)
              System.out.println("See Submit button");
              TimeUnitCreate timeUnitCreate = new TimeUnitCreate(
              JTextFieldStartDate.getText(),
              JTextFieldEndDate.getText(),
              JTextFieldStartTime.getText(),
              JTextFieldEndTime.getText(),
              (String)JComboBoxUnitOfMeasure.getSelectedItem(),
              JTextFieldBlockSize.getText()
              timeUnitCreate.createTimeUnits();
              this.setVisible(false);
    System.out.println("Done creating Time Units.");
    // (new TimeUnitDefinition()).setVisible(true);
         void JButtonCalendar1_actionPerformed(java.awt.event.ActionEvent event)
         CalendarDialog calendarDialog = new CalendarDialog(parentFrame,"Date",true);
         calendarDialog.show();
         JTextFieldStartDate.setText(calendarDialog.getSelectedDate());
         void JButtonCalendar2_actionPerformed(java.awt.event.ActionEvent event)
         CalendarDialog calendarDialog = new CalendarDialog(parentFrame,"Date",true);
         calendarDialog.show();
         JTextFieldEndDate.setText(calendarDialog.getSelectedDate());
    }

Maybe you are looking for

  • Payroll PCR : IF THEN ELSE based on WT

    Hi, I need to get a decision based on the specific value of a WT. I created a PCR which I call using the IF - function. However, whenever entering the PCR it looks like I got no access to the stored wage types. Anyone knows the specific operand to ge

  • Qosmio X300-14Y- How can I find the old BIOS version 1.90?

    Hi, First of all; I am so sorry for my bad english knowledge.. Im from Turkey. I use x300 14 y since one week. factory bios version for vista 32 bit 1.90. But I upgraded to 2.10. How can I find old bios 1.90 setup file again. ? Please help.......

  • Tab Key Stopped Working

    Hello, Does anyone know why the tab key would suddenly stop working? Running an iMac 27" with wired keyboard. Very frustrating. Thanks, Matt

  • Installing Gizmo and setting up internet call on m...

    Hi, I installed Gizmo on my nokia E51.. The installation process was pretty simple.. I was provided with a 10 cent credit on my account.. I tried making a internet call from the option on my nokia e51.. I was not able to get through with the call. I

  • Nikon D200 Raw Support

    Hi there, I purchased Aperture immediately it came out in December 2005 at the same time I got my new Nikon D200. Now some 3 months later I still cannot use Aperture for my Raw files from the D200. Does anyone else have this same problem and/or does