Refresh Panel

Good day all, it's my first time taking a java class and we are at the end of the class and I have to do a project. I would like to know how to create a refresh button or option that will update the JPanel with the latest information.
Can someone please help me out with that or gear me in the right direction?
Thank you in advance.

Your question is so basic that it almost belongs in the new to java forum.
And how many times did you read the java tutorial or whatever books you use in class before you asked us here?
Try http://java.sun.com/docs/books/tutorial/uiswing/TOC.html

Similar Messages

  • Panel move working with Windows vista

    Hello Everyone,
    I've developed an application in LabWindows/CVI 9.0 under Windows Vista.
    On the release version, I've noticed that when I try to move the main panel (drag using panel title bar), while the application is in a continued loop making measurements and whithout process any system events, the main panel stops to refresh even if the application is still running. 
    I've seen on this forum that this is a quite common issue, so I removed title bar and set the main panel as not movable in application workspace.
    I recompiled the source code and I've seen that the main panel, whithout the title bar, could be surprisingly moved anyway only by clicking and dragging on a high corner of the panel. Obviously, during continued loop, if I try to move to the panel I always get the refresh panel stop.
    This doesn't happen if the application is compiled and run under Windows Xp.
    Anyone could give me any suggestions?
    Thanks a lot.
    Corrado.

    Ciao Corrado,
    can you post a simple example that reproduce this issue in order to verify it myself on different machines and different CVI versions in order to see if it's a bug or something else?
    Since you're saying it works under XP it might be a bug, and if it's so it would be very useful your example in order to fix it in the next releases.
    Thanks, 
    Andrea N.
    Systems Engineer ATE & RF - Mediterranean Region
    National Instruments Italy

  • Binding property of a Panel header in Declarative Component

    Hi,
    I created a Custom Declarative component, which has a panel header, i wanted to expose the binding property of the panel header so that the users can add partial triggers to it programaticaly,
    so i added a attribute of type RichPanelHeader, and used it in bindings of the panel header, but i am getting following error,
    Unserializable value:RichPanelHeader[UIXFacesBeanImpl, id=dc_cnt_ph1] for key:PropertyKey[phBinding] in console,
    and the value in bean is null.
    the code used in Panel Header of Declarative component,
    <af:panelHeader text="#{attrs.phScreenHdrTxt}" id="dc_cnt_ph1"
                          helpTopicId="#{attrs.phScreenHdrHelpTopicId}"
                          rendered="#{attrs.phScreenHdrRendered}"
                          inlineStyle="#{attrs.phScreenHdrInlineStyle}"
                          partialTriggers="#{attrs.phScreenHdrPartialTrigger}"
                          binding="#{attrs.phBinding}">
          <attribute>
              <attribute-name>phBinding</attribute-name>
              <attribute-class>oracle.adf.view.rich.component.rich.layout.RichPanelHeader</attribute-class>
            </attribute>   code used in the consumer app.
    <app:Container id="c2" phScreenHdrTxt="tab1" phBinding="#{TestBean.panelHeader}">
        <f:facet name="body">
          <af:group id="g1">
            <af:outputText value="Tab1" id="ot1"/>
            <af:commandButton text="Refresh Panel Header" id="cb1"
                              actionListener="#{TestBean.refreshPh}"/>
          </af:group>
        </f:facet>
      </app:Container>
    public class TestBean  implements Serializable{
      private RichPanelHeader panelHeader;
      public void refreshPh(ActionEvent actionEvent) {
        panelHeader.setText("Changed");
        AdfFacesContext.getCurrentInstance().addPartialTarget(panelHeader);
      public void setPanelHeader(RichPanelHeader panelHeader) {
        this.panelHeader = panelHeader;
      public RichPanelHeader getPanelHeader() {
        return panelHeader;
    }is there any solution or way to expose the binding property of any component in a custom declarative component?

    Hi,
    as a last resort, try javax.faces.component.UIComponent as the component class. It seems that none of the UI components implements serializable. javax.faces.component.UIComponent is the JSF base class that they all use.
    Let me know if this works. If not, I think I have another option that mayl do
    Frank

  • User clicks one link and goes to other and comes back state maintain prob

    1st say 2 links r there,
    aaa --> if u click on "aaa" (my requirement) as shown below.
    problem : the bean values still maintaining when i go to "bbb" and come back to "aaa".
    ======
    NOTE: when user enters all fields and clicks on button it goes to "second.jsp" their ajax response (1 table) generating. That means page wont get refreshed. (panel is fixed) only down 1 table will generate.
    on FROM DATE AND TO DATE basis.
    if user presses on F5 also state maintaining with the help of bean object.
    i.e, say user in response table clicks on "page 5" then presses on F5 .
    but problem is when user goes to "bbb" link or "ccc" or "dddd" (separate interface or link) which is not related to this
    (they r nearly 50 interfaces or links) and comes back to "aaa" still old response is there.
    NOTE: i can clear the bean object, but if i clear the bean object in "onload" or general i cant handle F5 issue.
    bbb
    ccc
    ddd
    sample
    =====
    first.jsp
    =====
    <jsp:useBean id="sd" class="TestPage" scope="session">
    </jsp:useBean>
    <jsp:useBean id="sptb" class="TestPageBean" scope="session">
    </jsp:useBean>
    <script type='text'/javascript'>
    function testfun()
    --ajax response.
    forwarding to to
    "second.jsp"
    </script>
    <%
    HttpSession mdsession=request.getSession(false);
    if(mdsession!=null){
    String s1=sptb.getTxtname();
    String s2=sptb.getTestselect();
    %>
    <form>
    <table>
    <tr><td><input type='text' name='fromdate' value='fromdate'></td></tr>
    <tr><td><input type='text' name='todate' value='todate'></td></tr>
    <tr><td><select name='testselect''><option value=1>aaa</option></select></td></tr>
    <tr><td><input type='contains' name='txtname' value=''></td></tr>
    <tr><td><input type='button' name='clickname' value='Click' onclick='testfun()'></td></tr>
    </table>
    </form>
    <%
    %>
    second.jsp (this is ajax response)
    =======
    <%
    String txtname= request.getParameter("txtname");
    String testselect= request.getParameter("testselect");
    String fromdate= request.getParameter("fromdate");
    String todate= request.getParameter("todate");
    --storing in bean
    sptb.setTxtname(txtname);
    sptb.setTestselect(testselect);
    sptb.setTxtname(fromdate);
    sptb.setTestselect(todate);
    ---database conn...resultset values retrieved on "fromdate" and "to date" basis
    out.println("<table><tr><td>testeno</td><td></testename></td><td>fromdate</td></tr></td>");
    while(rs.next())
    out.println(rs.getString(3);
    %>
    output
    ====
    input screen
    1 fromdate
    1 todate
    1 selectbox
    1 contains
    1 button
    -> after clicking on button ajax response displayed below is (with out page refresh)
    1 table gets displayed on "FROM DATE" AND "TO DATE" BASIS
    with pagination

    Michael,
    Thanks a lot for the reply.
    In the case you have mentioned, how does application has to know the user is 'moving away'[clicking on other role] from the application.
    Thanks in advance,
    Regards,
    Ganga

  • How to build "Query by example" Report?

    I want to create a report which allows user to select which columns to return.
    It is similar to "Query by example" form. Have someone done that before and share me the PL/SQL how to do that?
    Thanks in advance.

    I got the answer, u need to set table.setFilterModel("") and refresh panel collection which contains this table
    whenever u need to make "Query By Example" button of panel collection invisible.

  • JRadioButton actionListener shows troble.plz help.

    hai forum,
    My project has a part where i select a class file,display its methods and then display JTextFields for the parameters of the method in a separate panel.
    My problem is that clicking different radio buttons(methods) do not bring about a change in the panel.
    my code for selecting and displaying method is
            public void selectClass_actionPerformed(ActionEvent e)
                if(e.getSource()==selectClass)
                    //refresh panel
                    methodPanel.removeAll();
                    methodPanel.revalidate();
                    //  Code To Generate a FileChooser
                     //instantiate class FilterClass
                    JFileChooser jfilechooser=new JFileChooser();
                    Filterclass filter=new Filterclass();
                    //Set selection mode for file chooser
                    jfilechooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
                    //set file filter
                    jfilechooser.setFileFilter(filter);
                    int returnVal = jfilechooser.showOpenDialog(this);
                    if(returnVal == JFileChooser.APPROVE_OPTION)
                        try
                                String str = jfilechooser.getSelectedFile().getName();
                                String parent=jfilechooser.getSelectedFile().getParent();
                                classFileList.addItem(str);
                                classFileList.disable();
                                // Create a File object on the root of the directory containing the class file
                                File file = new File(parent);
                                // Convert File to a URL
                                URL url = file.toURL();         
                                URL[] urls = new URL[]{url};
                                // Create a new class loader with the directory
                                ClassLoader cl = new URLClassLoader(urls);
                                StringTokenizer st = new StringTokenizer(str,".");
                                String s = st.nextToken ();
                                 Class c = cl.loadClass(s);
                                //Get the Methods Of the Selected Path
                                Method methods[]=c.getDeclaredMethods();
                                for(int i=0;i<methods.length;i++)
                                    int modifiers=methods.getModifiers();
    if(Modifier.isPublic(modifiers)||Modifier.isStatic(modifiers))
    String a= "";
    a=methods[i].getName();
    //Get the Parameters
    Class[] parameterTypes=methods[i].getParameterTypes();
    String parameterString = "";
    for(int k=0;k<parameterTypes.length;k++)
    if(k==0)
    parameterString = parameterTypes[k].getName();
    else
    parameterString = parameterString+","+parameterTypes[k].getName();
    parameterCount = parameterTypes.length;
    System.out.println("num of para"+parameterCount);
    /*Create RadioButton Dynamically*/
    String radioName=a+"("+parameterString+")";
    j=new JRadioButton(radioName);
    methodPanel.add(j,true);
    methodlistPane.getViewport().add(methodPanel,null);
    j.setBounds(100,(100+(i*50)),100,50);
    group.add(j);
    //Class methodradioactionlistener implemented below
    j.addActionListener(new MethodRadioActionListener());
    }//end of if loop
    }//end of for loop
    }//end of try loop
    catch(Exception e1)
    StringWriter sw = new StringWriter();
    e1.printStackTrace(new PrintWriter(sw));
    String stacktrace = sw.toString();
    System.out.println("stacktrace = " + stacktrace);
    }//end of catch loop
    }//end of if loop
    }//end of e.getsource loop
    }//end of method loop
    And my MethodRadioActionListener is
            private class MethodRadioActionListener implements ActionListener
                public void actionPerformed(ActionEvent e1)
                        if(parameterCount==0)
                            textfieldPanel.removeAll();
                            textfieldPanel.repaint(); 
                            JLabel nopara = new JLabel();
                            nopara.setText("NULL PARAMETER");
                            nopara.setBounds(new Rectangle(210, 80, 175, 25));
                            textfieldPanel.add(nopara);
                            textFieldPane.getViewport().add(textfieldPanel,null);
                        } //END OF IF LOOP
                        else if(parameterCount>0)
                            textfieldPanel.removeAll();
                            textfieldPanel.repaint();
                            tf = new JTextField[parameterCount];
                            for(int j = 0; j < tf.length; j++)
                                //DISPLAYS TEXT FIELDS
                                tf[j] =new JTextField(null,5);
                                textfieldPanel.add(tf[j],true);
                                tf[j].setBounds((100+(j*100)),100,100,10);
                                textFieldPane.getViewport().add(textfieldPanel,null);
                            } //END OF FOR LOOP
                        } //END OF ELSE IF LOOP
                } //END OF ACTION PERFORMED METHOD
             } //END OF CLASS
             Clicking the radio button do not bring about any change.A single textfield is generated always.
    Plz help me fix my mistake.
    Thank you.

    Yes, as you mentioned only one action is being done that is of the last method.I tried bringing the code ,ParameterCount=k; ,inside for loop so that it takes thenumber of parameters of only one method that i select.But still i find the same kind of action takes place.
    Is there any other way out to solve my problem?How can i get the parameterCount of only one single method?
    Is it advisable to write the radioButton actionPerformed method inside the actionPerformed method for selectClass menuItem, rather than as a separate class.
    Thank you

  • Panel is not getting refreshed.i see a jam of old and new graph and lines

    hi friends
    i am attaching my code .when i adjust the slider position the size of the graph will increase(scaling).when i scroll to see the entire graph the screen is not getting refreshed properly.
    no leads ..can be 3,12 ...try any arbitary ...(stored in a txt file)
    myfile.txt=consider some 600 random numbers for testing.
    public class ECGDisplay extends JFrame implements WindowListener
          Container contain;
          JSlider sliderX,sliderY,sliderCount;
          JTextField Xval,Yval,Count;
          int [] time=new int[600];
          int []Volt=new int[600];
         Simpanel[] panelname;
          float relX=1;
          float relY=1;
          LineBorder lineborder,lineborder1;
          JPanel ScalingAdjustersPanel,ECGDisplayPanel;
          JScrollPane Scroll;
          JViewport vp;
          JRadioButton RbX,RbY,RbCount;
          ButtonGroup group;
          private FileInputStream in;
          String horizontalScalingSliderLabel = "mm/S";
          String verticalScalingSliderLabel = "mm/mV";
          String heightOfTileSliderLabel ="Height of tile in uV";
          boolean flag=false;
          int LeadCount;
          int x=20,y=15;
          int count=4;
          JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
          java.awt.Dimension screen = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
    public ECGDisplay()
         super();     
         this.setTitle("ECG FRAME");
         this.addWindowListener(this);
         this.setSize (screen.width, screen.height);
         contain=getContentPane();
         EcgLeadCount();
         EcgWindowCreation(LeadCount);
    void  EcgLeadCount( )
              try
               FileInputStream in = new FileInputStream("no_Leads.txt");
               BufferedReader br = new BufferedReader(new InputStreamReader(in));
               LeadCount=Integer.parseInt(br.readLine());
               in.close();
               catch (Exception e)
                 System.err.println ("Error while reading no of leads");
    void PanelAdjuster()
              for(int i=0;i<LeadCount;i++)
              panelname.setPreferredSize(new Dimension((30*x),(count*y)));
    void readMyFile(int i)
              try
              FileInputStream in = new FileInputStream("myfile.txt");
              BufferedReader br = new BufferedReader(new InputStreamReader(in));
              String strLine;
              for (int j = 0; j < Volt.length; j++)
                   Volt[j] = Integer.parseInt(br.readLine());
                   in.close();
              catch (Exception e)
                   System.err.println ("Error writing to file");
    public void EcgWindowCreation(int LeadCount)
         for(int i=0;i<600;i++)
              time[i]=i;
              ScalingAdjustersPanel=new JPanel();
              ECGDisplayPanel=new JPanel();
              panelname=new Simpanel[LeadCount];
              for(int i=0;i<LeadCount;i++)
                   panelname[i] =new Simpanel();
                   System.out.println(panelname[i]);
                   readMyFile(i);
                   ECGDisplayPanel.add(panelname[i]);
              ScalingAdjustersPanel.setPreferredSize(new Dimension(200,(screen.height-50)));
              ScalingAdjustersPanel.setLayout(new BoxLayout(ScalingAdjustersPanel,BoxLayout.Y_AXIS));
              ECGDisplayPanel.setLayout(new BoxLayout(ECGDisplayPanel,BoxLayout.Y_AXIS));
         sliderX=new JSlider(10,50,20);
         sliderY=new JSlider(15,50,15);
              sliderCount=new JSlider(4,10,4);
              ScalingAdjustersPanel.add(sliderCount);
              sliderCount.setBorder(BorderFactory.createTitledBorder("uV"));
              sliderCount.setMajorTickSpacing(2);
              sliderCount.setMinorTickSpacing(1);
              sliderCount.setPaintTicks(true);
              sliderCount.setPaintLabels(true);
              sliderCount.setVisible(false);
              sliderCount.addChangeListener(new SliderChange());     
              ScalingAdjustersPanel.add(sliderX);
              sliderX.setBorder(BorderFactory.createTitledBorder(horizontalScalingSliderLabel));
              sliderX.setMajorTickSpacing(10);
              sliderX.setMinorTickSpacing(5);
              sliderX.setPaintTicks(true);
              sliderX.setPaintLabels(true);
              sliderX.addChangeListener(new SliderChange());
              sliderX.setVisible(true);
              ScalingAdjustersPanel.add(sliderY);
              sliderY.setBorder(BorderFactory.createTitledBorder(verticalScalingSliderLabel));
              sliderY.setMajorTickSpacing(10);
              sliderY.setMinorTickSpacing(5);
              sliderY.setPaintTicks(true);
              sliderY.setPaintLabels(true);
              sliderY.addChangeListener(new SliderChange());
              sliderY.setVisible(false);
              RbX=new JRadioButton ("horizontal Scaling",true);
              RbY=new JRadioButton ("vertical Scaling");
              RbCount=new JRadioButton ("height Of Tile");
              group=new ButtonGroup ();
              group.add(RbX);
              group.add(RbY);
              group.add(RbCount);
         ScalingAdjustersPanel.add(RbX);
              ScalingAdjustersPanel.add(RbY);
              ScalingAdjustersPanel.add(RbCount);
              RbX.addActionListener(new buttonSelected());
              RbY.addActionListener(new buttonSelected());
              RbCount.addActionListener(new buttonSelected());
              lineborder = new LineBorder(Color.GRAY,2,true);
              lineborder1 = new LineBorder(Color.RED,2,true);
              ScalingAdjustersPanel.setBorder(lineborder);
              JScrollPane Scroll=new JScrollPane(ECGDisplayPanel);
              contain.setLayout(new BorderLayout());
              splitPane.setOneTouchExpandable(true);
         splitPane.add(ScalingAdjustersPanel);
         splitPane.add(Scroll);
              contain.add(splitPane,BorderLayout.CENTER);     
              setVisible(true);
    public void windowClosing(WindowEvent evt)
              this.setVisible(false);
              this.dispose();
    public void windowOpened(WindowEvent evt) {}
    public void windowClosed(WindowEvent evt) {}
    public void windowIconified(WindowEvent evt) {}
    public void windowDeiconified(WindowEvent evt) {}
    public void windowActivated(WindowEvent evt) {}
    public void windowDeactivated(WindowEvent evt) {}          
    public class SliderChange implements ChangeListener
              public void stateChanged(ChangeEvent AE)
                   Object sliderOBJ=AE.getSource();
                   if(sliderOBJ==sliderX)
                        x= sliderX.getValue();
                        relX=(float)x/20;
                   else if (sliderOBJ==sliderY)
                        y= sliderY.getValue();
                        relY=(float)(((float)y*count)/(15*4));
                   else if(sliderOBJ==sliderCount)
                        count=sliderCount.getValue();
                        relY=(float)(((float)y*count)/(15*4));
                   PanelAdjuster();
                   ECGDisplayPanel.repaint();
                   ECGDisplayPanel.updateUI();
    public class buttonSelected implements ActionListener
         public void actionPerformed(ActionEvent e)
              JRadioButton slid1=(JRadioButton)e.getSource();
              if(slid1==RbX)
              sliderX.setVisible(true);
              sliderY.setVisible(false);
              sliderCount.setVisible(false);
              if(slid1==RbY)
              sliderX.setVisible(false);
              sliderY.setVisible(true);
              sliderCount.setVisible(false);
              if(slid1==RbCount)
              sliderX.setVisible(false);
              sliderY.setVisible(false);
              sliderCount.setVisible(true);
    public class Simpanel extends JPanel
         public void paintComponent(Graphics g)
              g.setColor(Color.BLUE);
              for(int i=0;i<599;i++)
                   g.drawLine((int)(time[i]*relX),(int)(Volt[i]*relY),(int)(time[i+1]*relX),(int)(Volt[i+1]*relY));
              Graphics2D g2=(Graphics2D) g;
         //drawing a rectangle
         double leftX=0;
         double topY=0;
              double width=x;
              double height=y;
                   g2.setColor(Color.RED);
              for(int j=0;j<=count;j++)
                   for(int i=0;i<30;i++)
                             Rectangle2D rect=new Rectangle2D.Double(leftX,topY,width,height);
                             g2.draw(rect);
                             leftX=leftX+x;
                        leftX=0;
                        topY=topY+y;
    public static void main(String args[])
              ECGDisplay frame=new ECGDisplay();
    Edited by: garlapati on Apr 7, 2009 10:18 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    From the [custom painting tutotial|http://java.sun.com/docs/books/tutorial/uiswing/painting/index.html]:
    Most of the standard Swing components have their look and feel implemented by separate "UI Delegate" objects. The invocation of super.paintComponent(g) passes the graphics context off to the component's UI delegate, which paints the panel's background. For a closer look at this process, see the section entitled "Painting and the UI Delegate" in the aforementioned SDN article.

  • Refreshing the panels when new content added?

    Hey, guys. My first post here; hope I'm not too much of a JNewbie for you. :)
    I'm getting my feet wet in Swing, working on an invoice program for work. I want it to look like a regular invoice, with fields for SKU, description, cost per unit, units, and total per line item. Right now, I have those five fields in a Jpanel that I add to the bottom of the layout.
    The problem is that I need the ability to go to File => Add New Item... and have another JPanel with those five fields add to the bottom so a 2nd item can be added to the form below the first. I tried making a function that adds them to the panel, using the same type of syntax that the generated code (using a form builder in NetBeans) did. I don't see the lines get added.
    My thought is that there is some function I need to call to redraw or refresh the panel so that the new components start drawing. However, my Great Javadoc Adventure has turned up no clues.
    Can anyone please give me a hand with making this happen, or at the least coming up with an alternate solution that will achieve similar results?
    Thanks much.
    Jaeden Stormes
    [email protected]

    I tried revalidate() , but no change.
    Here's the function I'm using to try to add the item...
    private void NewLineItem()
    javax.swing.JPanel jLine = new javax.swing.JPanel();
    jLine.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
    jItemCode.setHorizontalAlignment(javax.swing.JTextField.CENTER);
    jLine.add(jItemCode, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 110, -1));
    jCourseDelivery.setHorizontalAlignment(javax.swing.JTextField.LEFT);
    jLine.add(jCourseDelivery, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 0, 240, -1));
    jItemQuantity.setHorizontalAlignment(javax.swing.JTextField.CENTER);
    jLine.add(jItemQuantity, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 0, 110, -1));
    jItemRate.setHorizontalAlignment(javax.swing.JTextField.CENTER);
    jLine.add(jItemRate, new org.netbeans.lib.awtextra.AbsoluteConstraints(460, 0, 100, -1));
    jItemAmount.setHorizontalAlignment(javax.swing.JTextField.CENTER);
    jLine.add(jItemAmount, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 0, 100, -1));
    jLineItemSection.add(jLine);
    jLineItemSection.revalidate();
    pack();
    JLineItemSection is a JPanel inside my frame.
    Any suggestions? I think the way I am using the AbsoluteContraints is screwed up, as I'm having a lot of trouble with the layouts in general. The form editor in NetBeans (at least, the version in 3.6) needs a LOT of work.

  • How Do I update/refresh my Services View in the Panel ?

    Hi, writing new cfcs and changing cfcs does not update the cfcs in the view of the service panel. And there is no update or refresh button. How can I update the view ?

    You can right click on the RDS node in server browser view and select Refresh Active RDS Server.

  • Help needed in refreshing a Panel

    I have created a GUI, which is having 2 windows. window1 is having a panel,that displays an array of buttons. from window1, clkicking "add" button window2 appears. in window2 I am adding new values to the button array of window1. window2 is having a button "ok".
    My requirement is when I'll add new buttons thru window2 to the button array in window1, and after clicking the "ok" button in window2, the window1 should be refreshed with the new button in the button array.
    I have already tried one solution for it.I put the creation, addition of buttons to panel & its visibility in a function and I called the function while clicking the "ok" button in window2. But it is showing a list of event dispatch error.
    If any of you have any better idea, please let me know soon.so that I can proceed further.
    Regards

    Do the following in window2 after adding the values to window1;
    window1.repaint();
    window1.validate();Hope this fixes your problem....And if not, then I need some code to work it.
    Cheers,
    Bolo

  • Help needed in refreshing a panel in my window.

    I have some problem in refreshing a panel of a window.
    Here I am writting the sample code bellow.
    My program contains 2 classes, one is "Test" other is "Testwindow".
    class Test contains main(),displays the buttons reading from the string array obtained by listing a directory in my local file system through the panel p2 .If I click "Add" button in Test, class Testwindow's constructor is called & "Testwindow" is visible, which has a textfield. If you enter a string in the textfield, that string will be stored as a file in the same directory that the 1st window use. here I choose "C:\\temp" of my filesystem as the directory.
    My requirement is:
    when I enter a string in the textfield of Testwindow, then after clicking "Finish" button, that inputted string should be added to the panel p2 of 1st window(Test)during runtime.It means the panel p2 should be refreshed reading from the "C:\\temp" as soon as a new button is added to temp directory during runtime.
    If any of you have idea over this,please help sending me the updated version of the code given below.
    Regards.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    public class Test extends JFrame
         JPanel p1,p2;
         JButton b1,bdir[];
         File f;
         String s[];
         int n,nmax;
         public Test()
              super("Test");
              JPanel con=(JPanel)getContentPane();
              con.setLayout(new BorderLayout());
              addWindowListener(new WindowAdapter(){
                   public void windowClosing(WindowEvent e)
                        System.exit(0);
              p1=new JPanel();
              p2=new JPanel();
              p2.setLayout(new GridLayout(nmax,1));
              b1=new JButton("Add");
              b1.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent e)
                        if(e.getActionCommand()=="Add")
                             new Testwindow();
              p1.add(b1);
              f=new File("c:\\temp");
              s=f.list();
              n=s.length;
              nmax=n+20;
              bdir=new JButton[n];
              for(int i=0; i<n; i++)
                   bdir=new JButton(s[i]);
                   bdir[i].setHorizontalAlignment(AbstractButton.LEADING);
                   p2.add(bdir[i]);
              int hor=ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED;
              int ver=ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;
              JScrollPane jsp=new JScrollPane(p2,hor,ver);
              con.add(p1,"North");
              con.add(jsp,"Center");
              setSize(250,300);
         public static void main(String arg[])
              Test frame=new Test();
              frame.setVisible(true);
    class Testwindow extends JFrame implements ActionListener
         JPanel p1,p2,p3;
         JLabel l1;
         JTextField tf1;
         JButton b1,b2;
         String s1, sdir[];
         public Testwindow()
              setTitle("Testwindow");
              Container con=getContentPane();
              con.setLayout(new BorderLayout());
              p1=new JPanel();
              p1.setLayout(new GridLayout(1,2));
              p2=new JPanel();
              l1=new JLabel("Enter a string: ");
              tf1=new JTextField();
              b1=new JButton("Finish");
              b1.addActionListener(this);
              p1.add(l1);
              p1.add(tf1);
              p2.add(b1);
              con.add(p1,"North");
              con.add(p2, "South");
              setSize(300,150);
              show();
         public void actionPerformed(ActionEvent e)
              if(e.getActionCommand()=="Finish"){
                   try{
                        s1=tf1.getText();
                        File id_name=new File("C:\\temp\\"+s1+".txt");
                        FileOutputStream out=new FileOutputStream(id_name);
                        out.close();
                   catch(IOException x)
                        System.out.println("Exception caught"+x);
                   this.setVisible(false);

    You have 2 JFrame's: Test and TestWindow
    In order for TestWindow to send messages to Test it needs a reference of Test. Therefor write in TestWindow this:private Test parentFrame;
    public void setParentFrame (Test t)
      parentFrame = t;
    }... then after create an instance of TestWindow in Test call this method like this:...
    TestWindow tw = new TestWindow ();
    tw.setParentFrame (this);
    ...Next, in Test create a method that will be called when a string is inputted:public void sendString (String s)
      //update the panel or whatever
    }call this method when the user clicks on a button or whatever in TestWindow:parentFrame.sendString (s);greetz,
    Stijn

  • Help needed in refreshing a panel in  a JFrame.

    I have some problem in refreshing a panel of a window.
    Here I am writting the sample code bellow.
    My program contains 2 classes, one is "Test" other is "Testwindow".
    class Test contains main(),displays the buttons reading from the string array obtained by listing a directory in my local file system through the panel p2 .If I click "Add" button in Test, class Testwindow's constructor is called & "Testwindow" is visible, which has a textfield. If you enter a string in the textfield, that string will be stored as a file in the same directory that the 1st window use. here I choose "C:\\temp" of my filesystem as the directory.
    My requirement is:
    when I enter a string in the textfield of Testwindow, then after clicking "Finish" button, that inputted string should be added to the panel p2 of 1st window(Test)during runtime.It means the panel p2 should be refreshed reading from the "C:\\temp" as soon as a new button is added to temp directory during runtime.
    If any of you have idea over this,please help sending me the updated version of the code given below.
    Regards.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    public class Test extends JFrame
    JPanel p1,p2;
    JButton b1,bdir[];
    File f;
    String s[];
    int n,nmax;
    public Test()
    super("Test");
    JPanel con=(JPanel)getContentPane();
    con.setLayout(new BorderLayout());
    addWindowListener(new WindowAdapter(){
    public void windowClosing(WindowEvent e)
    System.exit(0);
    p1=new JPanel();
    p2=new JPanel();
    p2.setLayout(new GridLayout(nmax,1));
    b1=new JButton("Add");
    b1.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent e)
    if(e.getActionCommand()=="Add")
    new Testwindow();
    p1.add(b1);
    f=new File("c:\\temp");
    s=f.list();
    n=s.length;
    nmax=n+20;
    bdir=new JButton[n];
    for(int i=0; i<n; i++)
    bdir=new JButton(s);
    bdir.setHorizontalAlignment(AbstractButton.LEADING);
    p2.add(bdir);
    int hor=ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED;
    int ver=ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;
    JScrollPane jsp=new JScrollPane(p2,hor,ver);
    con.add(p1,"North");
    con.add(jsp,"Center");
    setSize(250,300);
    public static void main(String arg[])
    Test frame=new Test();
    frame.setVisible(true);
    class Testwindow extends JFrame implements ActionListener
    JPanel p1,p2,p3;
    JLabel l1;
    JTextField tf1;
    JButton b1,b2;
    String s1, sdir[];
    public Testwindow()
    setTitle("Testwindow");
    Container con=getContentPane();
    con.setLayout(new BorderLayout());
    p1=new JPanel();
    p1.setLayout(new GridLayout(1,2));
    p2=new JPanel();
    l1=new JLabel("Enter a string: ");
    tf1=new JTextField();
    b1=new JButton("Finish");
    b1.addActionListener(this);
    p1.add(l1);
    p1.add(tf1);
    p2.add(b1);
    con.add(p1,"North");
    con.add(p2, "South");
    setSize(300,150);
    show();
    public void actionPerformed(ActionEvent e)
    if(e.getActionCommand()=="Finish"){
    try{
    s1=tf1.getText();
    File id_name=new File("C:\\temp\\"+s1+".txt");
    FileOutputStream out=new FileOutputStream(id_name);
    out.close();
    catch(IOException x)
    System.out.println("Exception caught"+x);
    this.setVisible(false);

    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import javax.swing.*;
    public class test extends JFrame {
      JPanel p1, p2;
      JButton b1, bdir[];
      File f;
      String[] s;
      int n, nmax;
      public test() {
        super("Test");
        p1 = new JPanel();
        p2 = new JPanel();
        p2.setLayout(new GridLayout(nmax ,1));
        b1 = new JButton("Add");
        b1.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            new Testwindow(test.this);
        p1.add(b1);
        f = new File("c:\\temp");
        s = f.list();
        n = s.length;
        nmax = n + 20;
        bdir = new JButton[n];
        for(int j = 0; j < n; j++) {
          bdir[j] = new JButton(s[j]);
          bdir[j].setHorizontalAlignment(AbstractButton.LEADING);
          p2.add(bdir[j]);
        JScrollPane jsp = new JScrollPane(p2);
        getContentPane().add(p1, "North");
        getContentPane().add(jsp, "Center");
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setSize(250,300);
        setLocation(100,100);
        setVisible(true);
       * Called by actionPerformed method in Testwindow
      public void addButton(String title) {
        JButton button = new JButton(title);
        button.setHorizontalAlignment(AbstractButton.LEADING);
        p2.add(button);
        p2.revalidate();
      public static void main(String[] args) {
        new test();
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import javax.swing.*;
    class Testwindow extends JFrame implements ActionListener {
      JPanel p1,p2,p3;
      JLabel label1;
      JTextField tf1;
      JButton b1,b2;
      String s1, sdir[];
      test client;
      public Testwindow(test client) {
        setTitle("Testwindow");
        this.client = client;
        p1=new JPanel();
        p1.setLayout(new GridLayout(1,2));
        p2=new JPanel();
        label1=new JLabel("Enter a string: ");
        tf1=new JTextField();
        b1=new JButton("Finish");
        b1.addActionListener(this);
        p1.add(label1);
        p1.add(tf1);
        p2.add(b1);
        getContentPane().add(p1, "North");
        getContentPane().add(p2, "South");
        setSize(300,150);
        setLocation(360,100);
        setVisible(true);
      public void actionPerformed(ActionEvent e) {
        JButton button = (JButton)e.getSource();
        if(button == b1) {
          try {
            s1=tf1.getText();
            File id_name=new File("C:\\temp\\"+s1+".txt");
            FileOutputStream out=new FileOutputStream(id_name);
            out.close();
          catch(IOException x) {
            System.out.println("Exception caught"+x);
          s1 = tf1.getText();
          client.addButton(s1);
          this.setVisible(false);
    }

  • How can I make the spry accordion remember the panel open when I refresh the page or jump to a new page?

    How can I make the spry accordion remember the panel open
    when I refresh the page or jump to a new page?
    I am using the accordion feature on all my pages as a
    navigation aid. It has three panels. When you refresh the page the
    panel goes back to the default pane... Is there a way of
    controlling this so that the browser can remember the pane that is
    open (say set a variable, cookie, other?)

    Look for "Set the default open panel" on the following page:
    http://labs.adobe.com/technologies/spry/articles/accordion_overview/index.html
    Keep in mind you would need to change that bit of code on
    every page. The only way to do it more dynamically would be to
    include a custom javascript or PHP/ASP style script in order to
    change the value.

  • Refresh components in a panel

    hi ,
    How to refresh components present in a panel, i tried validate and revalidate...
    actually i have text boxes and combo boxes in a panel and this panel changes for a tree event listener . i.e ,when ever i click on any of the childs in that tree the content present in the text boxes in that panel should get refreshed.as i am using the same panel for all the childs in that tree.
    I would be grateful to you if you help me out of this problem.
    Thanks
    lankss

    If your text boxes have to change when you click and depend on node names , you need to define a listener which gets control every time you click. In your listener, you may retrieve the node name, and therefore you are able to display what you want somewhere else (ie. Text boxes)
    Here is an example that I have implemented myself :
           mytree.addTreeSelectionListener(new TreeSelectionListener() 
              public void valueChanged(TreeSelectionEvent e)
                   node =  (DefaultMutableTreeNode)       mytree.getLastSelectedPathComponent();
                   if(node == null)  return;
                    TreePath tP = mytree.getSelectionPath();
                            String NodePath = tP.toString();  // same as a string
                   if (node.isLeaf())
                        refreshTextBox(....)    //   do what you want here
                   else
                          //   do what you want here
         );Hope this can help.
    Gege

  • How to refresh the panel's display in listener?

    I have a Jcombobox and a panel(square,background color:white). I want user to choose the panel's size from the combobox and thus change the panel's display. However, when I choose a value from combobox, the panel's size DOES change, but the display cannot be rerfreshed realtimely. It still display the panel by previous size. If I minimize the whole window and restore, then the panel gets refreshed, displaying by new size.
    Can anybody tell me how to refresh the panel's display dynamically? thank you a lot.
    sraiper

    if we bounce the listener the connections to other might be lost.NO!
    The listener contacts the DB to establish the initial connection between client & DB.
    After the connection between DB & client has started, the listener has NO involvement between DB & client.
    Stopping the listener has NO impact on existing sessions.
    Edited by: sb92075 on Jul 28, 2009 4:37 PM

Maybe you are looking for

  • How can I move ALL Tools to the left side of the Acrobat XI interface?

    Hi, all: I really tried to find this in assorted Adobe 'resources'. I looked in 'Workspace'. I'm burnin' work time here. ALL Tools, Fill & Sign, Comments, the whole schmear. HELP! I really didn't want to be fenced in to just the "Acrobat Feature Requ

  • How to create a dynamic newsflash using dreamweaver and PHP

    Hi there,    I would like to create a dynamic newsflash using dreamweaver and PHP in that the newsflash will be pulling information from a MySQL database. The newsflash should also have a link to view more information about the piece of news a user w

  • Company code pop up

    hi, i have a problem with the pop up that appears while we run FB60 transaction. the pop up comes once when we enter for the first time, if i want to enter for the next time it doesnot give the company code popup. for that i got a solution of using t

  • No Sharing in Win iTunes 7.0.2?

    After ensuring port 3689 was open on the firewall, I cannot get iTunes 7.0.2 for WinXP to display other Shared iTunes libraries or to share my library with other users. My WinXP machine's library does show up on MacOS machines (like my G4 laptop), bu

  • Why are the pictures in Windows Live / Skydrive photo albums not visible ?

    Icons are grey. Pictures are visible with IE9.