JButton icon update problem

Hi
I'm creating a JPanel with some JButtons set to different icons to create a seatmap. There are two kinds of JButtons: Existing Seat, Available Seat. The code is set up to allow an Available to switch icon to Existing if pressed. In that case the previous Existing becomes available switching its own icon.
The problem is that the first time the screen is created all Available status buttons work correctly, but the first selected Existing seat does not go available upon choosing a new seat. If the first existing seat is pressed before pressing an available things work perfectly.
To give an example, when the screen is first created seat 33C is currently selected as the existing seat and seats 32A and 34C are available. If the first button I press is 32A it switches icons to become Existing but 33C does not go to Available. Now if I press any of the other available seats such as 34C 32A becomes available and the new selected seat (34C) becomes Existing. All this time 33C does not change icons - stays at Existing - so I have two Existing seats showing.
However if I click on 33C at any time it becomes "Live" - starts behaving correctly.
Any suggestions/ advice much appreciated. have enclosed code snipped below:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Iterator it2 = thisRow.values().iterator();
while (it2.hasNext()) {
final Seat s = (Seat) it2.next();
thisSeat = s.row + s.col;
final JButton seatButton = new JButton();
seatButton.setOpaque(false);
seatButton.setBorderPainted(false);
seatButton.setIcon( (Icon) iconTable.get(s.status));
if (thisSeat.equalsIgnoreCase(currSeatStr)) {
seatButton.setIcon( (Icon) iconTable.get(s.STATUS_EXISTING));
s.status = s.STATUS_EXISTING;
innerClassHelperInstance.prevSeatButton = seatButton;
innerClassHelperInstance.prevSeat = s;
seatButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
if (s.status.equalsIgnoreCase(s.STATUS_AVAILABLE)) {
tmpExistingSeatLabel.setText(s.row + s.col);
innerClassHelperInstance.prevSeat.status = s.
STATUS_AVAILABLE;
innerClassHelperInstance.prevSeatButton.setIcon( (Icon)
iconTable.get(s.STATUS_AVAILABLE));
seatButton.setIcon( (Icon) iconTable.get(s.STATUS_EXISTING));
innerClassHelperInstance.prevSeatButton = seatButton;
innerClassHelperInstance.prevSeat = s;

Hi! How can I change the icon attached to a JButton
when running the application? By calling setIcon.
setIcon method doesn't work.. Yes it does.
Not even if I put an updateUI() after that..There is no need for that as the button will be updated automatically. So you must be doing something wrong. To begin with, maybe you can explain what you mean by "doesn't work".

Similar Messages

  • Jelly Bean Update Problems on Xperia S Tablet

    I think we need a new topic for Jelly Bean update problems and fixes.
    Solved!
    Go to Solution.

    small fonts and icons blurry pixelated in notification or google agenda widget
    browser crashes a lot.
    Missing jelly bean home launcher
    Wifi disconnecting for no reason.
    Animations aren't smooth tough tablet is more responsive then android 4.0.3 release6b

  • HT4623 iPad software update problem....help!!

    My iPad does not have a "software update" icon in the General Settings.  So, how do I accomplish a software update?

    Use your computer and iTunes:
    See the chart below to determine whether you can upgrade your device and what you can upgrade to.
    IPhone, iPod Touch, and iPad iOS Compatibility Chart
         Device                                       iOS Verson
    iPhone 1                                      iOS 3.1.3
    iPhone 3G                                   iOS 4.2.1
    iPhone 3GS                                 iOS 6.1.x
    iPhone 4                                      iOS 6.1.x
    iPhone 4S                                    iOS 6.1.x
    iPhone 5                                      iOS 6.1.x
    iPod Touch 1                               iOS 3.1.3
    iPod Touch 2                               iOS 4.2.1
    iPod Touch 3                               iOS 5.1.1
    iPod Touch 4                               iOS 6.1.x
    iPod Touch 5                               iOS 6.1.x
    iPad 1                                          iOS 5.1.1
    iPad 2                                          iOS 6.1.x
    iPad 3                                          iOS 6.1.x
    iPad 4                                          iOS 6.1.x
    iPad Mini                                     iOS 6.1.x
    =====================================
    Select the method most appropriate for your situation.
    Upgrading iOS
       1. How to update your iPhone, iPad, or iPod Touch
       2. iPhone Support
       3. iPod Touch Support
       4. iPad Support
         a. Updating Your iOS to Version 6.0.x from iOS 5
              Tap Settings > General > Software Update
         If an update is available there will be an active Update button. If you are current,
         then you will see a gray screen with a message saying your are up to date.
         b. If you are still using iOS 4 — Updating your device to iOS 5 or later.
         c. Resolving update problems
            1. iOS - Unable to update or restore
            2. iOS- Resolving update and restore alert messages

  • Sony liveware manager update problem

    Hi, my xperia arc s is facing an update problem in the liveware manager. The current software version in my phone is 3.2.7 but whenever i try to update to version 3.3.10, there show me this message. 'Package file was not signed correctly. Uninstall the previous copy of the app and try again.' I cant uninstall the app as it is a built in app. Please help. Thanks.

    @NightRequiem this is the same version as what I currently have without any problems. In this circumstance it would be worthwhile running a repair via PC Companion:
    1. Before you start you have to download the PC Companion software from http://www.sonymobile.com/gb/tools/pc-companion/
    and install it on your PC.
    2. Once installed on your PC, double-click the PC Companion icon on your desktop to start the update.
    Note! For some models you will be prompted to do a backup prior to the update and then restore.
    3. Install and open PC Companion then select Support Zone.
    4. Phone Software Update.
    5. Start.
    6. Repair Phone
    7. Continue
    8. Accept data removal
    9. Next
    10. Wait for prepare
    11. Select Phone
    12. Follow the connectionn steps
     - Official Sony Xperia Support Staff
    If you're new to our forums make sure that you have read our Discussion guidelines.
    If you want to get in touch with the local support team for your country please visit our contact page.

  • Problems playing on radio after update, problems playing on radio after update

    anyone having problems playing video from ipod,ipad or iphone on kenwood indash tvs since updating to ios 5

    HI,
    You can setup your Yahoo account via Mac Mail.
    Open the Mail app. From the menu bar click Mail / Preferences then select the Accounts tab, then select *Account Information*. Click + at bottom of the window under Accounts.
    That way you don't need Safari to access your Yahoo mail account.
    Since you haven't updated your software as yet, you should do that. Bear in mind, the percentage of users that post with 10.6.5 update problems here are less then 1% of all Mac users. Being a tech support forum it's normal to see posts for help. But not everyone has problems with updates. Very difficult to compare one users experience to another given the mix of third party apps, peripherals, and devices. No two systems are identical.
    Click your Apple menu / Software Update... make sure and repair permissions after the updates are installed.
    Launch Disk Utility. (Applications/Utilities) Select MacintoshHD in the panel on the left, select the FirstAid tab. Click: Repair Disk Permissions. When it's finished from the Menu Bar, Quit Disk Utility and restart your Mac. If you see a long list of "messages" in the permissions window, it's ok. That can be ignored. As long as you see, "Permissions Repair Complete" when it's finished... you're done. Quit Disk Utility and restart your Mac.
    Always make sure there is enough free space on the startup disk. Right or control click the MacintoshHD icon. Click Get Info. In the Get Info window you will see Capacity and Available. *Make sure you always have a minimum of 15% free disk space.*
    Carolyn

  • Update problem - VBDATA table

    Dear All,
    We have update problems in our Quality systems, and also in every R/3 system that we create from a Production system copy.
    Sometime the UPD and UP2 work processes hung without apparent reason.
    In the SM50 I can see one or more of my update processes running for a lot of time (many hours) on the table VBDATA without perform any action.
    In the tcode SM12 I donu2019t see any kind of lock, and I donu2019t understand why only sometime this problem happens.
    Of course, from the SM13 I can see that during this problem the system is not able to perform any kind of update.
    As I told in the beginning of the message, I have the same problem in other two R/3 systems, both created with a system copy from the production system.
    The Production and the Developer systems seem not affected by this problem.
    Have you got any idea about the reason of the problem?
    Even if the Production systems is not directly affected, all the IT department is not able to work on the Quality system (or any other Test system), and the only workaround is to kill the UPD (or UP2) WPs affected.
    Thanks in advance,
    Federico Biavati
    My R/3 System is a 4.7 on SLES9 and Oracle 10.2.0.2

    Hello Siva,
    This is what I did:
    > Check how many entries do you have in VBDATA currently.
    More than 1.000 in every SAP systems that Iu2019m creating from Production
    > You might want to run the reorganize updates program to clear the old updates
    > that are pending/in error
    Good point!!
    After the reorganization (ST14 u2013 Reorganize update requests) the table VBDATA is empty.
    Iu2019ll check and Iu2019ll let you know if the problem is definitively solved.
    Thanks for you help,
    Federico

  • Chart x scale update problem

    LabVIEW  8.5.1
    Sweep Chart Problem
    The x scale values do not update until after the 2nd sweep.  The red line cursor gets to the end of the sweep and starts the next, but the scale numbers do not update until the next sweep starts.
    It appears to be a problem with the chart, since it happens with any vi with a sweep chart.  I've used versions 6 through 7 for years and never seen this.  I've only recently moved to a new job with a new machine and version 8.5.1., so I'm not sure what to try.
    I've included a simple example.
    Thanks much,
    JSC321
    Attachments:
    Chart Sweep Scale Update Problem.vi ‏32 KB

    You have a typical race condition!
    There is no data dependency between the property node and the while loop, so in your case the loop starts executing first and the property node starts slightly later, immediately erasing the first point. Execution order is not defined.
    All you need to do is add a data dependency, e.g. as with the error cluster in the image. This forces the property node to complete before the loop is allowed to start.
    (Execution order is enforced even if the wire value is not even used inside the loop )
    Try it!
    Message Edited by altenbach on 12-23-2008 11:08 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    HistoryRace.png ‏10 KB

  • Jbutton icon in Applet

    Hi!
    i create an applet with somu buttons.
    How can i insert a file .gif or .png in a jbutton icon.
    where i have to put my gif files?
    Sorry for my english.
    thanks a lot

    import java.awt.*;
    import javax.swing.*;
    /** Simple example illustrating the use of JButton, especially
    *  the new constructors that permit you to add an image.
    *  1998-99 Marty Hall, http://www.apl.jhu.edu/~hall/java/
    public class JButtons extends JFrame {
      public static void main(String[] args) {
        new JButtons();
      public JButtons() {
        super("Using JButton");
        Container content = getContentPane();
        content.setBackground(Color.white);
        content.setLayout(new FlowLayout());
        ImageIcon cup = new ImageIcon("cup.gif");
        JButton button1 = new JButton(cup);
        content.add(button1);
        pack();
        setVisible(true);
        try {
          jbInit();
        catch (Exception ex) {
          ex.printStackTrace();
      private void jbInit() throws Exception {
    }This is some example code I copied off of the internet and edited for a very basic example. The file cup.gif is located in the correct directory and this file will compile from the command line and show the button graphic but from not JBuilder. Does anyone have any ideas? Thank you.

  • Updating problem...I have a update that starts out going through but then does not finish just keep running

    also with the update problem it says software update and below the running bar it says connecting to the server

    Please do the following:<br><br>
    #Go to [http://www.mozilla.com/en-US/firefox/fx/?ref=logo Download Firefox 4.0.1] and download a fresh installation file to the desktop.<br><br>
    #Then go to Add/Remove Programs, scroll down to "Mozilla Firefox" and remove it, choosing to keep your bookmarks, customizations etc., (''don't checkmark the box'').<br><br>
    #Then reboot and delete the folder called "Mozilla Firefox" at this location: C:\Program Files\Mozilla Firefox<br><br>
    #Finally run the installation file you downloaded to the desktop earlier.<br>
    Your bookmarks, customizations etc., are maintained in a different location and will become available to you again once you complete the installation.

  • 10.5.7 update problems

    After installing the 10.5.7 update, Mail, iTunes and iPhoto will not run anymore. Anyone else having this problem?

    jjtopspin wrote:
    Before I came to these apple discussions re: update problems with 10.5.7, I tried to update this version yesterday and at the end of the download this message came up, the update "Mac OS X update" can't be saved. The digital signature for this package is incorrect. The package may have been tampered with or corrupted since being signed to Apple.
    I got the same message. The downloaded file that generated the message was only about 560 KB, indicating it was an incomplete download. I moved it to the trash & tried again. The second download attempt succeeded. I had a minor if nerve-wracking issue with the update (the blue looping screen reported in another topic in this forum) but after a forced shutdown & restart the update was completed successfully.
    I have since updated my two other Macs so all those listed in my profile are now running 10.5.7. All do so without any problems & in fact work better & more stably than ever before.
    I doubt that I'm unusual in this respect. Some users will have problems but I believe most won't, & for those that do most problems will turn out to be caused by something other than the update itself. So it has been for every previous Leopard update; I see no reason to think this one will be any different.

  • Cache update problem in Integration Directory

    Hi all,
    We have a cache update problem in our PI development server.
    If we try to edit, save and activate any of the ID objects, under Cache notifications>Central Adapter Engine> all these objects are displayed as gray items.
    We have tried:
    1. Clearing the SLD Data Cache.
    2. Did SXI_CACHE complete refresh.
    3. Did CPA cache refresh.
    4. Did a complete cache refresh of the server.
    5. Restarted the server.
    But still the problem has not bee resolved. Could you pls provide your inputs and resolution points.
    Thank you very much.
    regards,
    Jack Nuson

    HI Jack ,
    first try to manually update the cache from ID select on your cache notifiaction and click on delta cache refresh button and refresh button .IF it does not yied any result then
    Perform a full cache refresh using the URL
    http://<host>:<port>/CPACache/refresh?mode=full . If the cache refresh happens properly then your problem will get resolved other wise you have to see the cache log to view why it failed there it will show you the exact reason . You might need to restart your java server also if the problem persist .
    Regards,
    Saurabh

  • Twitter Update Problem

    Seems I have a Twitter Update problem. 1. I have no pirated software on my computer either from the App Store or anywhere else. 2. I did buy a set off templates for iWork through the App Store with my Bosses Apple ID (it's for work). Is that really the problem. That's ridiculous.  The apple ID is mine, as is much of the software, but it's a computer use for work. If this is true it makes the App Store a lot less useful.

    my apologies I was so annoyed. I didn't bother to state my issue. The issue is: Twitter is constantly asking to be updated. Even after it's updated. Even if it's deleted. I looked at the forums for a solution and found that people were having this problem who installed pirated app store apps.
    I am logged into the app store on my account. All but one of the apps on my machine that come from the app store are on my account. However there is one piece of software on my account that I purchased, by logging out and logging in with her ID, purchasing it, installing and logging out, and again logging in as myself. I don't have an issue with that app. However Twitter, which was installed under my username, constantly says it needs to be updated. Hope that makes it clearer.

  • HT4623 Update problem

    Hello
    How do i solve problem when i'am doing my update from 5.1 to 6.1.2 the massage (3194) occured. Please help me to solve this update problem.
    I'am using iphone 4

    See this support document http://support.apple.com/kb/ts4451

  • File icon update crashes finder

    In Panther: I'll have a finder window open in icon mode and I resave a file in Photoshop and when the icon updates the finder window crashes.
    Anything I can do about it other than a work around?

    Have you tried restart and/or Repair Permissions
    george

  • TS3694 im trying to restore my iphone and itunes doesnt allow it to restore without updating. problem is that i have the latest update on my iphone so why is it forcing me to wait for a 7hr update download when i already have the update and only need to r

    im trying to restore my iphone and itunes doesnt allow it to restore without updating. problem is that i have the latest update on my iphone so why is it forcing me to wait for a 7hr update download when i already have the update and only need to restore?

    Sadly, the iPhone 3G can not be upgraded beyond iOS 4.2.1.

Maybe you are looking for

  • Portal Runtime Error : Any ideas?

    Hello There, Please help. I'm having a 'Portal Runtime Error' and would appreciate any lead: This is appearing in the MSS overview Page.. Portal Runtime Error An exception occurred while processing your request Exception id: 10:37_27/03/08_0005_73680

  • Enable access for assistive devices in Mavericks-how?

    How is "access for assistive devices" enabled in OS 10.9.3?  I've looked for it just about everywhere in System Preferences.  A third-party utility that I use needs it to work fully-and says at startup that it is not switched on.

  • Javascript error in uwc (reply, forward buttons)

    Our users have reported an "annoying" repeatable error which occurs at least once per session using UWC web-client. When they log in to UWC, read a message and click the buttons named Reply, Reply All, Forward, Forward Inline, an alert pops up: "Java

  • Screen exit for transaction IW31 for ref. object O150

    Hi, I need for find screen enhancement for trasaction iw31 in plant maintenance. The requirement is to add 2 more fields (Functional location and Assembly) in the 'reference object' O150 on header tab. Currently the reference object has 2 fields and

  • IView Timeout Error in Production

    Hi We are having one application developed by JSPDynPage ...this application will do lots of DB transactions...Some times when the load is very high on the DB the users will get this Iview Timeout error and they will not see any thing in the portal C