Isuue With Jpanel Refresh

I have one Jpanel in which i m adding buttons dynamically depending on the condition.
When i m running my application then only one button is displayed on the pannel , but as soon i click on the
edge of the pannel or trying to resize the pannel all the buttons are displayed.
I used all , panel.revalidate(),invalidate,repaint().
but these function r not helping.
it is showing all buttons only on clicking on edge or resizing..

To get better help sooner, post a [_SSCCE_|http://mindprod.com/jgloss/sscce.html] that clearly demonstrates your problem.
Use code tags to post codes -- [code]CODE[/code] will display asCODEOr click the CODE button and paste your code between the {code} tags that appear.
db

Similar Messages

  • Problem with Jpanel repaintingl

    Hi!
    I have a problem with Jpanel.
    First , I add a Jscrollpane to the panel and I don't
    see it.
    Second, I have a paint method in the Jpanel and I do there some painting but when I exe the application I can see the panel painting only when I put the mouse cursor
    on the place where the panel need to be.
    It is very strange.
    Help me.
    Yair.

    Example code??
    Can't tell what's wrong otherwise.
    First , I add a Jscrollpane to the panel and I don't
    see it.Have you added anything to this JScrollPane? Unless you set the scroll bar policies to always on you won't see anything if you haven't added anything to the scrollpane.
    Also, if you're only adding this scrollPane to your JPanel initilise it with
    JPanel whippet = new JPanel(new BorderLayout())
    .. then when you add your scrollPanel to your JPanel do this to make sure its added slap in the in middle of it:
    whippet.add(yourScrollPanel, BorderLayout.CENTER);
    Bit more info please - duuuuuuuuuuuuuuuude (man, "Finding Nemo" was well funny didn't you think.. anyways, that's besides the point.... could just be my 8 year old mental age though.. who knows.)?

  • How to limit data range in a Line chart with Time Refresh Control

    Hi All,
    I have a Line chart with Time Refresh Control and I would like to make some constraints to this navigation.
    For example, I would like to limit the user to navigate in a data range of 8 hours.
    Is this posible?
    Thanks in advance

    Hi Pedro,
    as far as I know, this is not possible using the time controls on an iChart. However, you may have some success by using your own time controls which call JavaScript methods exposed by the applet.
    For example, you could begin by hiding the time and calendar buttons on an iChart, and creating some buttons of your own. For instance, to set the start date of a query (and thus the start date of the iChart using the query), you can use the following:
    document.getElementById("appletID").getQueryObject().setStartDate(<date string>);
    Using code like the above (look into the xMII script assistant and documentation), you should be able to build time controls which satisfy your requirements. The exact format of <date string> in the sample above will depend on the date format defined in the query template this script calls.
    Hope this helps,
    Sascha

  • MATERIALIZED view on two tables with Fast Refresh

    i Wanted to create MV on two tables with Fast refresh on commit.
    I followed below steps
    create materialized view log on t1 WITH PRIMARY KEY, rowid;
    create materialized view log on t2 WITH PRIMARY KEY, rowid;
    CREATE MATERIALIZED VIEW ETL_ENTITY_DIVISION_ASSO_MV
    REFRESH fast ON commit
    ENABLE QUERY REWRITE
    AS
    select A.ROWID B.ROWID,a.c1, DECODE(a.c1,'aaa','xxx','aaa') c2
    from t1 A
    join t2 b
    on AB.c1= CD.c2;
    i am getting below error.
    Error report:
    SQL Error: ORA-12054: cannot set the ON COMMIT refresh attribute for the materialized view
    12054. 00000 - "cannot set the ON COMMIT refresh attribute for the materialized view"
    *Cause:    The materialized view did not satisfy conditions for refresh at
    commit time.
    *Action:   Specify only valid options.
    Basically i want to take record in MV by joinig two tables and if both of the base tables will updated then record should reflect in materialised view.
    Please do the needfull.

    does the table support PCT? the other restrictions on joins look to be ok in your statement.
    maybe try creating first with on demand instead of commit to see does it create.
    http://docs.oracle.com/cd/B19306_01/server.102/b14223/basicmv.htm
    >
    Materialized Views Containing Only Joins
    Some materialized views contain only joins and no aggregates, such as in Example 8-4, where a materialized view is created that joins the sales table to the times and customers tables. The advantage of creating this type of materialized view is that expensive joins will be precalculated.
    Fast refresh for a materialized view containing only joins is possible after any type of DML to the base tables (direct-path or conventional INSERT, UPDATE, or DELETE).
    A materialized view containing only joins can be defined to be refreshed ON COMMIT or ON DEMAND. If it is ON COMMIT, the refresh is performed at commit time of the transaction that does DML on the materialized view's detail table.
    If you specify REFRESH FAST, Oracle performs further verification of the query definition to ensure that fast refresh can be performed if any of the detail tables change. These additional checks are:
    A materialized view log must be present for each detail table unless the table supports PCT. Also, when a materialized view log is required, the ROWID column must be present in each materialized view log.
    The rowids of all the detail tables must appear in the SELECT list of the materialized view query definition.
    If some of these restrictions are not met, you can create the materialized view as REFRESH FORCE to take advantage of fast refresh when it is possible. If one of the tables did not meet all of the criteria, but the other tables did, the materialized view would still be fast refreshable with respect to the other tables for which all the criteria are met.

  • HT1310 when i starst my mac i get a flashing folder with a question mark. i tried rebooting and holding the option button then i get 2 boxes, one with a refresh arrow and one with a forward arrow neither of them seem to do anything. now what

    when i starst my mac i get a flashing folder with a question mark. i tried rebooting and holding the option button then i get 2 boxes, one with a refresh arrow and one with a forward arrow neither of them seem to do anything. now what

    Here is an article that describes what it is supposed to do:
    Startup Manager: How to select a startup volume
    If no Volumes are shown, it is telling you there are no potentailly bootable Volumes attached. That means your boot drive has died or the bootable image on it is unrecognizable.
    What Mac Pro ? by year, GHz, number of processors, screen size?
    What Mac OS X ?

  • A bug with JPanel?

    I got a very ackward problem with JPanel. Please check the code below:
    import javax.swing.JPanel;
    public BasePanel extends JPanel{
        public BasePanel(){
           super();
    public class bb extends javax.swing.JDialog {
        public bb(java.awt.Frame parent, boolean modal) {
            super(parent, modal);
            initComponents();
        private void initComponents() {
            final BasePanel basePanel1 = new BasePanel();
            setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
            basePanel1.setBackground(java.awt.Color.white);
            basePanel1.setBorder(new javax.swing.border.EtchedBorder());
            getContentPane().add(basePanel1, java.awt.BorderLayout.CENTER);
            pack();
        public static void main(String args[]) {
            new bb(null, true).setVisible(true);
    }Even though I set the back colour of the panel WHITE, it does not turn into white when the dialog becomes visible. However, if I use JPanel instead of BasePanel while creating panel object, everything works fine. Is this a bug? I compiled and run the code above with both jvm version 1.4.02 and 1.5 beta 2, but the result is same.

    sure I did. I left it the class keyword out unintentionally. Furthermore, why shall I setVisible(true) of the BasePanel before packing it? It hasn't been done so in JPanel source code.

  • E6-00: what's wrong with Belle refresh (and other ...

    I've been following this forum and have always been up-to-date with E6-00 firmware. I've been almost happy with Belle and was expecting hardly the Belle refresh version for the Music player upgrade. What I got was - ? I don't know. Just the new version and no instant visible change. However... :
    - the Music Player is the same. Meaning, no song search and still ridiculous user interface
    - the phone tries to establish the data connection quite often even if no application is open
    - the phone is hardly responsive from time to time (while looking for the network connection)
    - the phone does not want to connect to the wifi. Restart helps.
    - the phone loses the network operator and does not reconnect. Happened once (when roaming). Restart helps immediately.
    - the Microsoft Apps: pursued upgrade. I personally do not need them. The screen is simply to small to use them effectively.
    - (not a complaint) the battery life: I think the battery life is not really affected by the OS. Those complaining about shorter battery life should check how much time they spend using the phone, being connected to wifi, etc.
    I'm very disappointed with the E6-00. I try to keep it positive but it keeps me down with every (new) issue. Does anyone has advice what to do with upper mentioned issues? I bought the phone ~2 months after it was available. I'm assuming that these first production series can have hardware issues? My phone was on reparation twice: for the notification light (hardware thing) and bluetooth issues (voice not heard over the bluetooth headset). The latter is still present I think...
    I consider buying E71 since there's no other good (Nokia) phone on the market. What makes me sad the most is that my iPod touch does wifi connection and other things smoothlessly... But I don't want an iPhone (which is in principle the same as iPod touch), I just want a good Nokia.
    Regards,
    P

    strelamcqueen:
    I agree with your post except for the fact that Belle hosed my E6.  Meaning: if you look at all my other posts, it's all about the GPS data functions that were awesome with the E71 then went away with the E6 on Anna.  At least with Anna, there was an app called LeGPSData2 that restored most of the E71 GPS functionality.  LeGPSData2 is not compatible with Belle. Sooo, I am currently using my E6 ONLY because of the decent camera. 
    Belle made the UI look pretty but that's it.  I found the same problems with the responsiveness that you mentioned and issues with not connecting to my home wifi when I try to browse the net at home.  There's nothing like downloading a bunch of big files only to discover that I've chewed up a bunch of data because the phone didn't connect to wifi.  I put the wifi widget on one of my home screens and I make sure that I manually connect to wifi now before starting the browser. The Microsoft app via the upgrade were a joke. They actually took over Quick Office so that Excel and Word opened with MS Office Mobile.  This would be fine but they open so tiny they are unreadable and they are not editable with MS Office Mobile for some reason.  I removed the MS apps immediately.
    My battery life suffered a lot after Belle refresh.  With normal use as before the upgrade I would get home with about 50% battery with 3G ON.  With Belle refresh,  The battery won't make it through a full day with 3G on and I end up with about 25% battery at the end of the day with 3G off.  Good thing I don't use much data through the day!
    This is actually my second E6; long story but the first I upgraded to Belle and was disappointed with the loss of LeGPSData2 app.  This one I was forced to upgrade to Belle refresh because while updating Ovi Maps one night, the update completely deleted the Ovi Maps app and I could not get it back without updating the OS to Belle refresh. 
    So I am with you.  I too am very disappointed with the E6 but most of my disappointment comes from the software 'upgrades'.  If Nokia would just leave well enough alone, all would be fine.  I am sorry I have no advice to take care of the problems you and I are facing.  I am in search of a new phone now and if I don't downgrade to an E72, I won't be getting a Nokia again.  It's a sad story because I have been a die hard Nokia fan for a long time.
    DS
    @adrianhughes:
    HUH?  stelamcqueen is asking advice from other USERS.  That's what the forum is about.  

  • Replication with fast refresh

    hi everybody,
    I have a problem in replication with fast refresh. I used 2 Windows 2000 server with Oracle 9i Release 9.0.1.1.1 and I can't made the automatic update. This doesn't work and I cant use ON DEMAND.
    I made
    Remote server
    Create table teste (a number primary key, b varchar2(20));
    insert into teste (a, b) values (1, 'weqwuqeui');
    create materialized view log on teste with primary key;
    Server Local --------
    create materialized view admin.teste_mv
    build immediate
    refresh fast start with sysdate next sysdate + 1/1440
    with primary key as
    select * from teste@servidor1;
    Server Remote -------
    insert into teste (a, b) values (2, 'qwerty');
    The first line is in the materialized view teste_mv but the second never appear.
    I know it's a dumb trick but I can't solve this problem at the moment.
    If somebody can help I would appreciate.
    Thanks in advance

    thanks for the reply.
    The job_queue_processes parameter in both servers is set to zero
    The dba_jobs returned the following columns, every other columns are null. The next date and time is in the past.
    JOB LOG_USER 1
    PRIV_USER ADMIN
    SCHEMA_USER ADMIN
    NEXT_DATE 11-JUL-07
    NEXT_SEC 17:45:47
    TOTAL_TIME 0
    BROKEN N
    INTERVAL sysdate + 1/1440 FAILURES
    WHAT dbms_refresh.refresh('"ADMIN"."TESTE_MV"');
    NLS_ENV NLS_LANGUAGE='AMERICAN' NLS_TERRITORY='AMERICA' NLS_CURRENCY='$' NLS_ISO_CURRENCY='AMERICA' NLS_NUMERIC_CHARACTERS='.,' NLS_DATE_FORMAT='DD-MON-RR' NLS_DATE_LANGUAGE='AMERICAN' NLS_SORT='BINARY'
    MISC_ENV 0102000200000000
    INSTANCE 0
    Cheers

  • Materiazed view with fast refresh

    Hi All,
    I want to create a Materialized view with fast refresh.
    I think for fast refresh we need to set up a materialized view log first before the MV gets created.
    Can someone please provide the steps and the syntax to do this?
    I am new to MV creation so appreciate any help in this regard.
    Thanks.
    AS

    http://www.morganslibrary.org/library.html
    Look up Materialized View Log and Materialized View ... both on the same page ... build the demo MV and you can modify the code to build any others you wish.

  • NMac Pro 6core D500 problems with screen refresh: 10.9.3 warning!

    Avoid 10.9.3 on the Mac Pro 6 core, D500.
    Problem with screen refresh using Motion soon after updating OSX from Mac Pro late 2013 version of 10.9.2.
    I tried my Asus HDMI at all resolutions but to no avial. The screen juddered like it was Windows 95 without any GPU drivers.
    Apple's Tech Support had me use many key commands and finally we found out there was no issue with my hardware. Apple suggested a clean install before sending it back for repair. I was fortunate to have had made a backup in the Time Machine of my computer soon after installing all my apps. After restoring my computer is running 10.9.2 version made for the Mac Pros Late 2013. There are no more problems with screen redraw after using Motion.
    So, it is clear I cannot upgrade my Mac Pro to 10.9.3 while the issue with Motion's render engine messing with my screen refresh continues. Returning to 10.9.2 has made me realize 10.9.3 is slower and not as stable.
    I would suggest not upgrading unless you have a 4k monitor.

    Avoid 10.9.3 on the Mac Pro 6 core, D500.
    Problem with screen refresh using Motion soon after updating OSX from Mac Pro late 2013 version of 10.9.2.
    I tried my Asus HDMI at all resolutions but to no avial. The screen juddered like it was Windows 95 without any GPU drivers.
    Apple's Tech Support had me use many key commands and finally we found out there was no issue with my hardware. Apple suggested a clean install before sending it back for repair. I was fortunate to have had made a backup in the Time Machine of my computer soon after installing all my apps. After restoring my computer is running 10.9.2 version made for the Mac Pros Late 2013. There are no more problems with screen redraw after using Motion.
    So, it is clear I cannot upgrade my Mac Pro to 10.9.3 while the issue with Motion's render engine messing with my screen refresh continues. Returning to 10.9.2 has made me realize 10.9.3 is slower and not as stable.
    I would suggest not upgrading unless you have a 4k monitor.

  • Select List with Submit refreshes page to top force users to scroll down

    Hello All,
    I have Dependent Select List where this functionality driving select list submit values to a subsequent select list.
    The "Select List with Submit" refreshes page where the unintended by-product is page refresh, which returns to top of page and therefore force users to scroll back down.
    In other words: I have a long form page where I have a Dependent Select List. So when you change the value of the 1st select list it refreshes the 2nd. This is all fine, but when the refresh occurs, the Form-focus returns to the top of page. This makes the users scroll back down to the lower end of the Form where they left off. This would make usability problems for users.
    Anyway we can make the Form return where to the area(Item or Region) where the user was during the selection of the Select List?
    Thanks in advance,
    Konstantine

    HURRAY!! I got it to work perfectly using anchors. I am adding this message to help future ApEx developers.
    I have been searching the Forum for 3 days and have read numerous postings. There was a lot of good discussion on anchors and linking from page to page. But, nothing exactly like my situation.
    Situation: Have a page, PG4, with a button, PG4_BUTTON, that redirects to a different page, PG7. PG4_BUTTON has its 'Display In Region' field set to PG4_REGION. When PG4 is run and the form displays, the PG4_BUTTON is located at the bottom. When the user would click PG4_BUTTON, the user would be taken to PG7. (this is good) The user enters some data in PG7 fields and then clicks a create button, PG7_BUTTON. PG7_BUTTON would submit data. An After Processing, Go To Page, Branch would be activated when this button was pressed and then the user would be returned to a refreshed PG4, at the top. This forces the user each time to have to scroll down to the bottom of PG4 to continue. (this is NOT good)
    Solution: On PG4, I edited the region, PG4_REGION. For the region 'Title' I added an anchor before the actual name. So it looked like this:
    {a name="REGION_TO_RETURN_TO"></a}PG4_REGION
    please note: where I have the curly braces above '{' '}' you need to put < the pointed and '>'
    Next, on PG7, I edited the Branch. On the 'Edit Branch' page, in the 'Action' region, I changed the 'Target type' field from 'Page in this Application' to 'URL'.
    To the 'URL Target' text area field I added this:
    f?p=&APP_ID.:4:&SESSION.::::::#REGION_TO_RETURN_TO
    So, there you have it. If you still need to read other postings, here are a couple of the sites I read:
    Re: Lists that go to items
    Re: URL target on a button.  What is the syntax??
    How to use <a name="top">Hello I'm at the top </a> tags in apex url ?
    Re: anchor or go to item from a branch
    http://www.oracle.com/technology/products/database/application_express/howtos/howto_navigate_in_a_page-1.6.html
    http://www.echoecho.com/htmllinks.htm
    http://www.htmlcodetutorial.com/linking/linking.html
    http://www.w3schools.com/HTML/html_links.asp
    Thanks,
    Maggie

  • Stms buffer file is growing in produciton with queue refresh

    Dear friends,
    The buffer file in stms is growing with each refresh with the same entries getting copied for many times.
    Kindly suggest on the same.
    thnaks in advance.
    regards
    Jiggi

    can you attach a screenshot of your STMS routes?
    what is the value for CTC in your systems? (see STMS - Systems - choose QAS system. click on Transport tool tab)

  • Problems Refreshing with JPanels

    I currently have a simple app that has four buttons along the bottom, and a JPanel on top (lets call this panel the parentPanel). The JPanel only has a border around it, and another JPanel inside it (lets call this inner one the childPanel). Depending on which of the four buttons are pressed, the the childPanel should change (i.e. its changed to a completely different panel, with different content).
    However, the panels are not being repainted properly. If I simply change the panel (i.e. in the parentPanel, I call remove(childPanel), then childPanel = someOtherPanel, and finally add(childPanel), the screen wont show the changes until I resize the window. I've tried calling things such as invalidate and validate, revalidate, doLayout, repaint, and all of these do the same thing: it paints the new panel OVER the old one. i.e. the old content remains, and the new content is painted overtop so that you can see the old still where the new didnt overlap.
    I tried also using setVisible to false, and back to true, and this works fine, but I'm also sure there should be a proper way of doing this (after looking at the setVisible code, I realized this works because swing draws a rectangle over the space when set to false, which would effectively erase the old content).
    I also saw this thread which seems to be related, but nobody found a solution there either: http://forum.java.sun.com/thread.jspa?threadID=305694&messageID=1219759
    any help would be appreciated

    I think I've got the problem solved. Immediately after doing the add and remove, I called revalidate, and then repaint, and this seemed to fix it (as opposed to validate and repaint). Not really sure why this works, but oh well.
    Also, cardlayout isnt an option (i'm trying to make an installer program that will be usable in swing and can also be used with charva, which is a library that allows swing-based apps to be rendered in ASCII for a command prompt, and that does not have the cardLayout available).
    Message was edited by:
    DeepanT
    scratch that, validate OR revalidate works. I guess im just stupid:P

  • Container (JPanel) refresh problem

    Hello,
    In fact i have a panel (mainPanel) with a button OK, a another panel which display a specific MyJTable and combo box.
    In fact, when I clic OK Button, i want to charge my MyJTable with data depends on comboBox.
    First, i display a empty white panel and when i clic Ok i want to display my MyJTable.
    JPanel mainPanel = new JPanel();
    JPanel emptyPanel = new JPanel();
    JPanel combo = new JComboBox();
    JButton okButton = new JButton();
    MyJTable myJTable;
    mainPanel.add(emptyPanel);
    mainPanel.add(combo);
    mainPanel.add(okButton);I have a refresh problem, i try mainPanel.remove(emptyPanel) and thus mainPanel.add(myJTable), the remove works but the add no :(
    In ActionPerformed method when okButton:
    myJTable = new myJTable(combo);
    mainPanel.remove(emptyPanel);
    mainPanel.add(myJTable);
    mainPanel.repaint();Thanks for yu help!!

    Hi,
    have you tried playing with
    mainPanel.revalidate();
    mainPanel.revalidate();??
    Might help
    Phil

  • Need help with JPanel

    I put 2 tables in panel, then change them to other 2 tables, but I don't see the change.
    What should I add in order to see the change ?
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.table.*;
    public class MyTable extends JFrame {
         static JTable table1, table2;
         static JPanel panel = new JPanel(new GridBagLayout());
         static JScrollPane scrollPane = new JScrollPane(panel);
         public MyTable() {
              table1 = createTable(3, 4, new Integer(10));
              table2 = createTable(5, 2, new String("hi"));
              fillPanel();
              add(scrollPane);
              doSomething();
         private static JTable createTable(int rows, int columns, Object value) {
              DefaultTableModel model = new DefaultTableModel(rows, columns);
              for (int r = 0; r < rows; r++)
                   for (int c = 0; c < columns; c++)
                        model.setValueAt(value, r, c);
              return new JTable(model);
         private static void fillPanel() {
              GridBagConstraints c = new GridBagConstraints();
              c.gridx = 0; c.gridy = 0;
              panel.add(table1, c);
              c.gridx = 1; c.gridy = 1;
              panel.add(table2, c);
         private static void doSomething() {
              table1 = createTable(1, 6, new Boolean(true));
              table2 = createTable(5, 2, new Float(3.14f));
              // What should I do here ?
         public static void main(String[] args) {
              MyTable frame = new MyTable();     
              frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
              frame.pack();
              frame.setVisible(true);
    }

    OK... but I create a new table with a different number of columns. How
    will you set the new number of columns in the existing table ?
    My question is this posting has nothing common with other postings.Your question is all over the place. You don't really know what you are asking.
    Once you build a table and add it to the GUI, the "easiest" way to display new data, refresh the data or whatever is to simply use table.setModel(...). Its one line of code.
    Of course there is more than one way to do something, but just because it works does not mean it is a good approach. So removing old components and adding new components and revalidating the panel is more work. Not only in terms of code but also in terms of efficiency. Now you are creating extra JTable objects and there is more work for the garbage collector etc. Yes, these are all minor points, but why use the complicatied approach when you can solve your problem with one line of code?

Maybe you are looking for

  • Getting unique values from an arraylist

    Hi I have an arraylist that contains stringbuffer objects. The arraylist has duplicate values of the objects. I have to create another arraylist with only the unique values from the first arraylist. I tried it many ways and using many functions, but

  • Fatal error during installation - Error 1603 ONLY on XP

    My Dears, while installing any CS3 or CS4 Adobe product for my friend, at ~90% of installation error comes up: "Adobe Photoshop CS4 Error: Error 1603. Fatal error during installation." I am struggling to solve it for 3 days now, and of corse I have s

  • FM vendor_bdcdata

    Hi how to write program using FM vendor_bdcdata for upload the vvendor master data. Please help me on this. Moderator message - Moved to the correct forum Edited by: Rob Burbank on May 4, 2009 9:40 AM

  • Problem with the Transaction "BBPCF02" in Good Confirm (ITS)

    Hi, My search is not fetching any data in the ITS for Goods Confirm. If, I enter the existing PO number also, it is not giving any search results. The ITS screen is calling the Transaction "BBPCF02" for Goods Confirm for my user id. I have executed t

  • OOM on Windows 2008, WLS 10.3

    Customer running WLS 10.3 over JRockit - increasing heap size to 4G on 64bit system causes OOM exception! 1) He's using weblogic10.3 (10g) (64 bit) on Windows 2008 64bit version on Xeon processor with x86-x64 version jrockit1.6.0_05(jre) 2) When he u