How to show different JTable without flickering JFrame?

I write a simple application with 2 different tables. if user clicks "1" button, the frame will display table 1. else frame display table2. at the moment the code is like:
     JPanel panel1 = new JPanel();     
     ......//make the panel1 contains 2 buttons
     JPanel panel2 = new JPanel();
      ......//make the panel2 contains one table
     JFrame frame = new JFrame();     
     frame.getContentPane().add(panel1,BorderLayout.NORTH);
     frame.getContentPane().add(panel2,BorderLayout.CENTER);
     frame.setSize(700,500); frame.setLocatio(50,25);
     frame.setVisible(true);in ActionPerformed() method, the code is like:
      if (e.getActionCommand().equals("1")) {
          panel2 = new JPanel();
           ......//make the panel contains table1    
          frame.setVisible(false);
          frame.getContentPane().add(panel2, BorderLayout.CENTER);
          frame.setSize(700,500); frame.setLocatio(50,25);
          frame.setVisible(true);
       } else {  
           ...//do same thing with table2
       }there are 2 problems:
1. every time the frame will flush once if user clicks one button. how to make the frame only change the panel which contains new table but not the button panel?
2. about size: the user may resize the frame by draging one border of the frame. but the new frame always gets a fixed size. how to make the frame get the size the user adjusted?
Maybe solve the first problem can automatically finish the second problem. but I don't know how to do.
Thanks for any help.

I post the same question twice yesterday but receive no answer. I think it should be straight-forward if you know. Is it really that difficult? I need help!
Thanks.

Similar Messages

  • How to show modal window without popup in a web page using javascript

    Hi,
    How to show modal window without popup in a web page using javascript, means when the modalwindow is opened it should not ask for popup blocker alert......
    pls help me.....

    Thanx for ur reply,
    Actually the senario is when i click on a button, another jsp page should be displayed in a modal window without popup, but the functions alert() and confirm() will not accept the url path of the another jsp page...

  • How to show different Look & Feel to different users?

    Hi,
    how to show different Look & Feel to different users?
    Thanks & Regards,
    Venu--

    If you want the user to select then LookAndFeel then Visitor Tools.
    If you want to use code and dynamically change it then http://download.oracle.com/docs/cd/E13155_01/wlp/docs103/javadoc/index.html?com/bea/netuix/laf/PortalLookAndFeel.html
    if you have only a few combinations then you could even create different desktops and direct the user to the appropriate url

  • How to Show Different set of  Blob images in every page

    Hi i am using Crystal Report Server XI RAS Embedded Edition to built Dynamic Reports.
    Now i  have two datasets
    1. Main query with imageid field
    2. list of image blobs.
    this two datasets are linked with imageid  field and binded to ReportClientDocument.
    i have to show different image fields in every page of the report.  this images are differ in width and heights.
    i am able to show a single constant image field object from blob database field.
    but i could not able to find the solution to show different set of multiple images in different pages of the report.
    is there any formulas can be written or kindy give me a solution to achieve this.
    Regards,
    Padmanaban V
    Edited by: Padmanaban Viswanathan on Mar 15, 2010 11:59 AM

    See RAS samples [here|https://wiki.sdn.sap.com/wiki/display/BOBJ/NETRASSDK+Samples]. Look for "NET-CS2003_RAS-Managed_BE115_Add_Image" or "NET-VB2003_RAS-Managed_BE115_Add_Image-From-File".
    Ludek

  • How to show different size of custom fonts on different mobiles

    I am currently working on a J2ME project on which we are using low level API. We want to display custom fonts on mobiles and we want to show different size of fonts according tot he resolution and screen density of mobile screen resolution is provide by J2ME but screen density is not provided is there any way to calculate screen density using WURLF, Or any other third party api or JSR.

    See RAS samples [here|https://wiki.sdn.sap.com/wiki/display/BOBJ/NETRASSDK+Samples]. Look for "NET-CS2003_RAS-Managed_BE115_Add_Image" or "NET-VB2003_RAS-Managed_BE115_Add_Image-From-File".
    Ludek

  • How To Show Different Artwork For CD With Same Name?

    In 2002, Chris Botti released a holiday CD named December. In 2006 he also released another CD named December with the only difference being track 2 (Ave Maria) & track 7 (I Really Don't Want Much For Christmas which are not included on the 2002 release. These are not additional tracks but replace 2 songs from the original 2002 release. The album art is different for both CDs. So, how can I show these two CDs with the same name and same artist but with different artwork in Cover Flow mode? Help!
    iMac G5 1.8 Ghz iMac 1.8 GHz G5 17" Mac OS X (10.4.8) 1.5 GB RAM   Mac OS X (10.4.8)  

    If you store Album artwork the way i described using Command I (get info) - then the artwork is actually EMBEDDED in each song and is carried with that song wherever it goes.. and in this case it doesnt matter if u had 3 copies of the same album - all identical. You could even save a diff image for each tarck if u wanted.
    If there is no artwork embedded, then coverflow places the image in a separate folder that is only referenced by iTunes for the whole CD.
    You also might want to turn off coverlfow and continue doing what u had been doing in the past - add you won.
    I also think i know what may be happening. You say they are identical except for track 2 - But problem is - I don't think iTunes can handle 2 identical CD's from the same artist.
    Here's an experiment:
    Goto any of the songs.... right-click and select "Show in Finder" the Finder will open and show you the song file and its location. Do you see one album once or 1 album twice?
    If you see 2 of everything, i would recommend the following:
    Rename the first album "December (2002)" and the second "December (2006)" then iTunes will definately separate them out.

  • How to show different templates in one column

    Hello friends,
    I've a data like this one:
    var aData = [
         {name: "Dente", company: "http://www.sap.com"},
         {name: "Friese",  company: "Google"},
         {name: "Mann", company: "http://www.sap.com"},
         {name: "Schutt", company: "SAP"}
    and want to be showed in the table :
         if the 'company' begin with "http" , it should be a link,
         else, shows as a text
    How to do this ?
    Could you help me ?
    Thank you
    Here is a short demo can run in https://openui5.hana.ondemand.com/#test-resources/sap/ui/table/demokit/Table.html 
    but is not completed.
    Demo for test:
    var aData = [ 
         {name: "Dente", company: "http://www.sap.com"},
         {name: "Friese",  company: "Google"},
         {name: "Mann", company: "http://www.sap.com"},
         {name: "Schutt", company: "SAP"}
    //Create an instance of the table control
    var oTable2 = new sap.ui.table.Table({
         title: "Table with fixed columns Example",
         visibleRowCount: 7,
         firstVisibleRow: 3,
         selectionMode: sap.ui.table.SelectionMode.Single,
         navigationMode: sap.ui.table.NavigationMode.Paginator,
         fixedColumnCount: 2
    //Define the columns and the control templates to be used
    oTable2.addColumn(new sap.ui.table.Column({
         label: new sap.ui.commons.Label({text: "Name"}),
         template: new sap.ui.commons.TextField().bindProperty("value", "name"),
         sortProperty: "name",
         filterProperty: "name",
         width: "200px"
    oTable2.addColumn(new sap.ui.table.Column({
         label: new sap.ui.commons.Label({text: "Company"}),
         template: new sap.ui.commons.Link().bindProperty("text", "company").bindProperty("href", "company"),
         sortProperty: "linkText",
         filterProperty: "linkText",
         width: "400px"
    //Create a model and bind the table rows to this model
    var oModel2 = new sap.ui.model.json.JSONModel();
    oModel2.setData({modelData: aData});
    oTable2.setModel(oModel2);
    oTable2.bindRows("/modelData");
    //Initially sort the table
    oTable2.sort(oTable2.getColumns()[0]);
    //Bring the table onto the UI
    oTable2.placeAt("sample2");

    HI Sihao
    will this work?
    Example
    Thanks
    -D

  • How to show different value, other than whatever from database in a Field

    I have a repeatating frame (corresponding to one query).
    there are 6 fields (columns) in th RF.
    Now say in one of the column the database values are like 1,2,3,4 etc..
    I want to show 'ASSIGNED' corresponding to value 1, INPROGRESS corresponding to value 2 etc..
    Could you please tell me how can I do that?
    Regards

    Hi,
    You can create a formula column in your query and try below code. The formula column should have char as return data type
    IF :column = 1 then
       return 'ASSIGNED';
    ELSIF :column = 2 then  
       return 'IN PROGRESS';
    ELSIF :column = 3 then  
       return 'VALUE3';
    ELSIF :column = 4 then  
       return 'VALUE4';
    ELSE
       return 'VALUE5';
    END IF;Regards
    Manoj
    Edited by: ManojP on Jul 19, 2010 7:26 AM

  • How to show a jtable created when a tree node is selected in a jsplit pane

    hello,
    does anyone know how you would go about updating a jtable you have created in a split pane when the data of the jtable changes?
    i have a jtree that creates a jtable when a node is selected. i want to display this jtable in a split pane that is created when the gui is launched.
    any help appreciated. i know it has something to do with updating a table model but if anyone has any sample code of how to do this, could they post it?
    thank you.

    Hi Laura,
    When you make a selection on your JTree, what data are you send to the JTable? Is it an entirely new TableModel that gets set each time?
    If you don't already have an implementation, consider using one JTable and simply swap the models in and out on JTree selection. It's probably best to contain the JTable in JScrollPane also. Perhaps not necessary, but calls to revalidate and repaint on the JTable after setting whatever data it is you set should update what is displayed.
    Warm regards,
    Darren

  • Help: how to show 9i forms without browser

    Hi, I want to show 9i forms in separate frame without browser, and I use JInitiator. I use separateFrame=true, which worked. But my question is since I don't need the browser, I want to close it. The problem is it'll close the form too. I think the reason for that is the browser is the parent of the form. Can someone tell me whether is possible to close the browser page without closing the actual form? or is there any other way to display actual form without the browser frame. Please help! Thanks,
    Sa

    Thanx for ur reply,
    Actually the senario is when i click on a button, another jsp page should be displayed in a modal window without popup, but the functions alert() and confirm() will not accept the url path of the another jsp page...

  • How to input different values without logging out everytime in OATS

    Hi,
    I am new to OATS. I was trying the functional testing of a web application. For this I recorded it by first logged in the application then input some values in a field, submit it and logout.Then i tried to iterate it with different values in the input field, but the problem was that for every iteration it was logging in every time. How can i stop logging in everytime and put the values all in one login. Also can anyone provide me online tutorial for OpenScript used in OATS.
    Edited by: user13268396 on Jul 6, 2011 3:36 AM

    Hi,
    If you go to
    http://www.oracle.com/technetwork/oem/downloads/index-084446.html
    There is a section for Documentation download. Within this there is the OpenScriptUserGuide.pdf, with full explanations of the technology.
    For the iteration with out logging again you have to insert "for" loop.
    Regards,
    Srinivas

  • How to show different recorded audio channels in timeline

    I've recorded an interview with two microphones (one was really bad, so I only want to use the other recorded microphone). I imported the clip from the tape camera into FCP X. Now in FCP X on the timeline I only see one audio track when I seperate it from the video. The two microphones seems to be 'mixed'. This was different in FCP 7 where you see both audio channels seperated.
    How do I manage to seperate the 2 audio channels into 2 channels. I'v troed with Channel Configuration via Audio Inspector but I do not understand it.
    Thanks, Pim

    Select the clip in the timeline and in the audio tab in the inspector in the channels seection switch to dual mono. You can switch off a track here if you wish.

  • How to show different types of components in acolumn of a dataTable?

    Hi All,
    Based on the conditions, I may want to show outputText field in row 1 and Link in row two for a particular column. of a dataTable.
    How can I do this??
    Thanks
    Sudhakar

    Giri I have found a way to show various components on conditional basis
    Here is the below example for that approach
    1. Create a new Project
    2. Drag a dataTable component on default page (created by creator)
    3. Remove column 3
    4. Remove dummy data from Column 2
    5. drag OutputText Object into Column2
    6. drag Image component into column 2
    7. drag checkBox component into Column 2. Now youe Page1.jsp code should look like something like Below
    <h:dataTable binding="#{Page1.dataTable1}" headerClass="list-header" id="dataTable1" rowClasses="list-row-even,list-row-odd"
                            style="left: 192px; top: 120px; position: absolute" value="#{Page1.dataTable1Model}" var="currentRow">
                            <h:column binding="#{Page1.column1}" id="column1">
                                <h:outputText binding="#{Page1.outputText1}" id="outputText1" value="#{currentRow['COLUMN1']}"/>
                                <f:facet name="header">
                                    <h:outputText binding="#{Page1.outputText2}" id="outputText2" value="Number"/>
                                </f:facet>
                            </h:column>
                            <h:column binding="#{Page1.column2}" id="column2">
                                <f:facet name="header">
                                    <h:outputText binding="#{Page1.outputText4}" id="outputText4" value="Image/Text/CheckBox"/>
                                </f:facet>
                                <h:outputText binding="#{Page1.outputText7}" id="outputText7"/>
                                <h:graphicImage binding="#{Page1.image1}" id="image1" value="resources/prime.GIF"/>
                                <h:selectBooleanCheckbox binding="#{Page1.checkbox1}" id="checkbox1"/>
                            </h:column>
                        </h:dataTable>8. Now create a bean Called NumberBean
    9. Add properties oddRender,evenRender,primeRender of type boolean
    10.Add private method "isPrime" in Page1.java(default bean created by studio creator)
    * NumberBean.java
    * Created on July 16, 2005, 12:08 PM
    package webapplication11;
    * @author  user
    public class NumberBean {
         * Holds value of property oddRender.
        private boolean oddRender;
         * Holds value of property evenRender.
        private boolean evenRender;
         * Holds value of property primeRender.
        private boolean primeRender;
         * Holds value of property value.
        private int value;
        /** Creates a new instance of NumberBean */
        public NumberBean() {
         * Getter for property oddRender.
         * @return Value of property oddRender.
        public boolean isOddRender() {
            return this.oddRender;
         * Setter for property oddRender.
         * @param oddRender New value of property oddRender.
        public void setOddRender(boolean oddRender) {
            this.oddRender = oddRender;
         * Getter for property evenRender.
         * @return Value of property evenRender.
        public boolean isEvenRender() {
            return this.evenRender;
         * Setter for property evenRender.
         * @param evenRender New value of property evenRender.
        public void setEvenRender(boolean evenRender) {
            this.evenRender = evenRender;
         * Getter for property primeRender.
         * @return Value of property primeRender.
        public boolean isPrimeRender() {
            return this.primeRender;
         * Setter for property primeRender.
         * @param primeRender New value of property primeRender.
        public void setPrimeRender(boolean primeRender) {
            this.primeRender = primeRender;
         * Getter for property value.
         * @return Value of property value.
        public int getValue() {
            return this.value;
         * Setter for property value.
         * @param value New value of property value.
        public void setValue(int value) {
            this.value = value;
    private boolean isPrime(int prime)
            if(prime==2)
                return true;
            int factors=0;
            for(int i=1;i<=prime;i++)
                if(prime%i==0)
                    factors++;
                if(factors>2)
                    return false;
            return true;
        }11. Now add the NumberBean array as property in Page1.java
    12. You will see following methods and private variable in Page1.java file
         * Getter for property numberBeanArray.
         * @return Value of property numberBeanArray.
        public NumberBean[] getNumberBeanArray() {
            return this.numberBeanArray;
         * Setter for property numberBeanArray.
         * @param numberBean New value of property numberBeanArray.
        public void setNumberBeanArray(NumberBean[] numberBeanArray) {
            this.numberBeanArray = numberBeanArray;
         * Holds value of property numberBeanArray.
        private NumberBean[] numberBeanArray;
        13 Now modify the Constructor of Page1.java as below
             java.util.Vector results=new java.util.Vector();
                for(int i=1;i<=100;i++)
                    NumberBean bean=new NumberBean();
                    bean.setValue(i);
                    if(i%2==0)
                        bean.setEvenRender(true);
                        bean.setOddRender(false);
                    else
                        bean.setEvenRender(false);
                        bean.setOddRender(true);
                    if(isPrime(i))
                        bean.setPrimeRender(true);
                    else
                        bean.setPrimeRender(false);
              results.add(bean);
                numberBeanArray=(NumberBean[])results.toArray(new NumberBean[results.size()]);
           14. Now Change the JSP code as below
    <h:dataTable binding="#{Page1.dataTable1}" headerClass="list-header" id="dataTable1" rowClasses="list-row-even,list-row-odd"
                            style="left: 192px; top: 120px; position: absolute" value="#{Page1.numberBeanArray}" var="currentRow">
                            <h:column binding="#{Page1.column1}" id="column1">
                                <h:outputText binding="#{Page1.outputText1}" id="outputText1" value="#{currentRow['value']}"/>
                                <f:facet name="header">
                                    <h:outputText binding="#{Page1.outputText2}" id="outputText2" value="Number"/>
                                </f:facet>
                            </h:column>
                            <h:column binding="#{Page1.column2}" id="column2">
                                <f:facet name="header">
                                    <h:outputText binding="#{Page1.outputText4}" id="outputText4" value="Image/Text/CheckBox"/>
                                </f:facet>
                                <h:outputText binding="#{Page1.outputText7}" id="outputText7" rendered="#{currentRow['oddRender']}" value="Odd Number"/>
                                <h:graphicImage binding="#{Page1.image1}" id="image1" rendered="#{currentRow['primeRender']}" value="resources/prime.GIF"/>
                                <h:selectBooleanCheckbox binding="#{Page1.checkbox1}" id="checkbox1" rendered="#{currentRow['evenRender']}" value="Even Number"/>
                            </h:column>
                        </h:dataTable>JSF model really helps in various scenarios. Only thing we need is patience, Better understanding on Framework and some Investigative knowledge. :-)
    Thanks
    Sudhakar

  • Two alias in Mail: how to show different "from" names?

    I've been reading various threads about aliases in mail, but none have exactly described my situation. What I want to be able to do is set up aliases in my one account and have the mail shown as "from" a different name depending on which alias I've used.
    Here's my current set-up:
    Account Type: POP
    Description: POP account
    Email address: [email protected], [email protected]
    Full Name: myname & mywifesname
    Incoming mail server: pop.domain.com
    username: xxxxx
    password: xxxxx
    outgoing mail server: smtp.domain.com
    So, we can each send email "from" our own email address, but they're all marked as from "myname & mywifes name". How do I change it so if I select "[email protected]" the mail is shown as simply from "myname" and vice versa.
    I understand from reading other threads that the one thing I can't do is set up a separate account for each, as they will both have the same incoming server and username. (Which was exactly what I could do back in the dark ages of Outlook Express.)

    Unless you really just absolutely want to have your sent emails say they're from "Trevor C" or from "Trevor C's Spouse", you could just delete the full name entry from that account in Mail's Preferences (i.e., set full name field to null), and then any sent messages' "from" address will simply appear as being from [email protected] or from [email protected], depending on which "account" (alias) you selected in the "Account" pull-down menu. This would be, I think, the easiest patch for you to implement.
    People who get email from me get mail from "[email protected]" and not from "J.V." Personally, I hate the full name crap and wish there were a way to display the "from" field in my inbound message viewer pane in email address format, rather than full name format. But that's just me.
    (if you find that this solves your problem, or is actually helpful towards arriving at a solution to your problem, please consider clicking on either the "helpful" or "solved" buttons in the header of my post)

  • How to show JSP Presentation without using tags

    Hi,
    is it possible to show JSP BI Presentation such as Thin Crosstab without using Presentation JSP Tag. Is there a method that renders Presentation (passes parameter of ThinDataviewCommon type and writes Presentation HTML) to output stream? Please give a sample code.
    Slawek

    Hi,
    You can do this. Please look at the struts example code given (http://otn.oracle.com/sample_code/products/bib/content.html). Here a view is loaded in Struts Action class and stored in HttpSession. Then UIX renderer is used in JSP to access this object from HttpSession to render it.
    Hope this helps
    Shantanu

Maybe you are looking for

  • Sql Server 2012 Login Failed for user "NT Authority\System"

    I have installed SQL Server on a new server. I have been getting the following error on each of the database in it. Login failed for user 'NT AUTHORITY\SYSTEM'. Reason: Failed to open the explicitly specified database 'ABC'. [CLIENT: xxx.xxx.xxx.xxx]

  • Why Soundtrack 2.0.2 doesn't load after FCP ST2 upgrade?

    I just installed the Final Cut Studio 2 upgrade and now Soundtrack doesn't open anymore. This is the error I get: Dyld Error Message: Library not loaded: /System/Library/PrivateFrameworks/BrowserKit.framework/Versions/A/BrowserKit Referenced from: /A

  • ScanEngineTest.exe and KERNELBASE.dll Errors

    I have a new install of Exchange 2013 (SP1, CU6) and I am receiving errors every 30 minutes. They appear to be happening when Exchange tries to test the scan engine update.  Here are the errors: Any suggestions would be appreciated! Chris Log Name:  

  • Scheduling : at multilevel

    Hi all , I have FG contains SFG1 , SFG1 contains SFG2 . I  am doing backward scheduling . after MRP , in MD04 the planned order dates and time r as follows : For FG :         date               time  Order finish   : 30.03.2008     17:30:00 Order sta

  • Reflection problem: Creating Objects

    The Reflection Tutorial mentions this line "Fortunately, with the reflection API you can create an object whose class is unknown until runtime" but the examples given are hardcoding the classnames!!! Here is the example given class SampleNoArg { publ