Buttons disappear

Hi all,
I'm sorry, I'm not sure if my problem relates to some of the other postings I've read on the forum or if it's something else I'm not aware of but the problem is this: I display a JFrame with a few JButtons for different options, like a menu of sorts and it works fine but if I recall my method to display the JFrame again later the buttons aren't visible, they're there and work if you click where they should be but I was hoping someone could tell me what I'm doing wrong. Why won't they show up?
Thanks in advance
Denise

Every time you call drawMenu you are creating another panel3 and adding the buttons to it; they can only be used once, ie, added to one component. Try setting up your frame, panel and buttons one time and then using your event handling code to control the visiblitiy of your frame instead of trying to recreate parts of it.
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
public class laingden
  private JButton lookupButton = new JButton("Browse Known Issues");
  private JButton createButton = new JButton("Log New Issue");
  private JButton exitButton = new JButton("Exit");
  private ButtonListener listener = new ButtonListener();
  private JFrame frame = new JFrame();
  public laingden()
    JPanel panel3 = new JPanel();
    panel3.setLayout(new GridLayout(1,3));
    panel3.add(lookupButton);
    panel3.add(createButton);
    panel3.add(exitButton);
    lookupButton.addActionListener(listener);
    createButton.addActionListener(listener);
    exitButton.addActionListener(listener);
    frame.getContentPane().add(panel3, BorderLayout.SOUTH);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.pack();
    frame.setVisible(true);
  public static void main(String args[])
    new laingden();
  private class ButtonListener implements ActionListener
    public void actionPerformed(ActionEvent event)
      String input;
      if ((JButton)(event.getSource()) == lookupButton)
        frame.hide();
        JOptionPane.showMessageDialog(null, "Menu closed");
        //I call another method here
//        drawMenu();
      else if ((JButton)(event.getSource()) == createButton)
        frame.hide();
        JOptionPane.showMessageDialog(null, "Menu closed");
        //I call another method here
//        drawMenu();
      else if ((JButton)(event.getSource()) == exitButton)
        System.exit(0);
}

Similar Messages

  • How do I turn off the automatic full screen feature that makes the top bar (with the minimize buttons) disappear?

    I just downloaded Firefox 4 on a Dell laptop with WinXP. When I'm in a browser window the window resizes automatically and the bar at the top (with the minimize, full and close buttons) disappears. When I drag the cursor up to the top the window resizes again and that top bar appears. Makes me crazy. How do I turn it off?

    I'm not aware of the behavior you're describing. I've never seen it, and just tested it for myself. I cannot get windows to zoom to full screen just from moving them to or along the top of the screen. Is this only happening in Photoshop? If so, it may be a Photoshop issue. If not, have you installed any kind of third-party software that might be doing that? Try rebooting in safe mode and see if the problem persists then. If it doesn't, but comes back when you reboot normally, the problem is caused by some third-party software you have installed.

  • On my PC, in I-Tunes, my iPod (touch) button disappears every time I try to sync or update.  Everything has been rebooted, but no changes. Any ideas on how to sync to the IPod?

    On my PC, in I-Tunes, the iPod (touch) button disappears every time I try to sync or update.  Everything has been rebooted, but no changes. Any ideas on how to sync to the IPod?  Better yet, how to keep the ipod button on screen when itunes is open and the ipod is connected?

    - Have you tried another USB port and cable?
    - Inspect the dock connector for bend or missing contacts, foreign material, corroded contacts, broken, missing or cracked plastic.

  • The share button disappeared from my Facebook add-on just before I upgraded to Firefox 5.0. I thought by upgrading and reinstalling the add-on it might come back, but it didn't. All other FB buttons are there, near as I can tell. Any ideas? I'm using XP3.

    The share button disappeared from my Facebook add-on just before I upgraded to Firefox 5.0. I thought that maybe by upgrading and reinstalling the add-on it might come back, but it didn't. All the other FB buttons are there, near as I can tell. Any ideas? I'm still using XP3.

    Hello,
    I had the same problem with finding this file.
    There's no such file in Mac OS X version of Skype. But there's a directory for your Skype user account in /Users/%current_user_name%/Library/Application Support/Skype/
    try:
    quitting Skype
    renaming old folder
    signing into the Skype

  • WD Java iView button disappears

    Hello All,
    We have a Webdynpro Standard iView for ESS/ MSS , we are facing the followig scenario as follows
    the iView is getting display in the iView content area in the portal .  We have a system tray being enabled , now when we minimise and them maximise the system tray , the button disappears from the screen (when the application is first loaded on the iView the button is displayed ). this prolem is not faced when we refresh the iView by clicking the system tray --> refresh , but only happens on the minimise and maximise action.
    Tried to see, if this behaviour can be changed with changing the WD UI settings on the portal side(ctrl + secondary mouse  click). but was unable to do so .
    Could this be handle without touching the WD code ?
    Ronniee

    hi
    How are you using this iVew ? Have you added this iView to a page or workset ? or are you using this iView by itself ? Which object property have you changed? is it the iView or the page ?
    Lemme know the details
    and will take it up from there
    Sheril

  • After I upgraded to iOS 5, my Genius icon/button disappeared. How do I get it back on my iPhone?

    After I upgraded to iOS 5, my Genius icon/button disappeared when using my music player on my iPhone. I am not using iTunes Match, just ensured it's disabled. How do I get my Genius icon/button back on my iPhone? Genius is enabled in iTunes, using the latest version of iTunes on all machines. Help! Thank you!

    Thanks, Huntress, but it's not in More either. I'm talking about the genius button/atom icon that used to appear in the center/top part of the screen while a song plays in the music player, like in this image (I used to be able to tap the atom icon to create a genius playlist on my iphone):
    Now, when I play a song, there is no atom icon/genius button like in the following image. I've already tried tapping where it used to be and it doesn't come back.

  • Image button disappears in pdf output

    I have converted an image into a clickable button in Indesign, but the image button disappears in the pdf output.
    I also noticed that while I was creating the button and in the Button and Foam menu the "appearance" eye icon is greyed out.
    Can anybody help? Thanks!

    It looks like you used InDesign CS6 (because you called it the Button and Form panel).
    It's OK that the appearance eye icon was grayed out. Here's how it should look:
    When you export, did you choose File > Export > PDF (Interactive)?

  • Link Buttons Disappearing

    I am working on a help project extracted from a .chm file. I
    am unfamiliar with the creation of the original help file but when
    viewing the compiled .chm file a series of topics following a
    particular browse sequence (for a Quick Tour) include buttons
    ("Next" and "Previous") as an alternative to using the browse
    sequence viewer. When viewing these pages in RoboHelp, I cannot
    find any sign of these buttons, and if I edit one of these topics
    in any way the buttons disappear from that topic in the compiled
    .chm file. I'm trying to figure out:
    1. Where I can find some sign of these buttons in Robohelp.
    2. Why the buttons disappear from the .chm file when I edit
    one of these topics in RoboHelp.
    3. How to put these buttons back in as they are helpful in
    navigating through the Quick Tour.

    Steve ~ Welcome to the discussions. Click once on the navigation bar to select it. Then drag the right side "handle" towards the left.

  • IMovie 5.02 unstable issue...buttons disappear/flicker

    Hi can anybody help?
    We are running
    PowerPC flatscreen iMac
    Osx 10.4.4
    QT 7.04
    iMovie 5.0.2
    For some time we've had great success with iMovie now suddenly...
    For some reason when we try to import via firewire from a canon video camera (which weve used successfully in the past)the imovie interface seems to go a little flakey - buttons disappear/flicker and whilst we can control the camera ....we cannot import...the imovie screen remains blue...
    Anybody any ideas ...could it be we have too new a version of quicktime?
    Thank you
    imac G5   Mac OS X (10.4.4)  

    I've had the same problem. I have a canon elura 100. Everything was fine 3 days ago. Now when I try to download, I can control my camera from my imac but no picture shows up n the monitor and I discovoered that all my clips go directly to my trash can. My buttons also disapper/flicker. If I press on where the button should be, the button works.

  • ADF Table - Command buttons disappear when no rows returned for table

    We have a command button that navigates to a create screen, when the table returns no rows the button disappears. We need to have this displayed always and within the ADF table. The code looks like:
    <f:facet name="selection">
    <af:tableSelectOne text=""
    binding="#{Search.tableSelectOne1}"
    id="tableSelectOne1">
    <af:commandButton actionListener="#
    bindings.ExecuteWithParams1.execute}"
    text="Edit n"
    action="edit"
    binding="#{SearchCtgry.commandButton3}"
    id="commandButton3">
    <af:setActionListener from="#{row.Code}"
    to="#{processScope.toCode}"/>
    </af:commandButton>
    </af:tableSelectOne>
    </f:facet>

    try placing the command button within the "actions" facet of the table. It will place it above the actual rows of the table. You could also use the "header" facet.
    <af:tableSelectOne text=""
    binding="#{Search.tableSelectOne1}"
    id="tableSelectOne1">
    <f:facet name="actions">
    <af:commandButton actionListener="#
    bindings.ExecuteWithParams1.execute}"
    text="Edit n"
    action="edit"
    binding="#{SearchCtgry.commandButton3}"
    id="commandButton3">
    <af:setActionListener from="#{row.Code}"
    to="#{processScope.toCode}"/>
    </af:commandButton>
    </f:facet>
    </af:tableSelectOne>

  • Label of a button disappears when its enabled

    We have a button in our forms which remains disabled by default.
    So, by default it works fine and we are able to see the label of this button correctly.
    On based of certain conditions this button gets enabled using the below line of code
    set_item_property('Block',enabled,property_true);
    However, when this statement gets executed label of the button disappears.
    It appears to be a blank button without any label text.
    Iconic property of the button is already set as NO
    Please help!!!

    Probably a bug with your specific version, you did not give anyway. You should consider upgrading/patching to a more recent version.
    Francois

  • Retake button disappears after Reviewing Quiz

    Long time lurker, first time poster...
    I have a quiz template that I'm trying to finalize for my department using Cp 5.5 and the retake quiz button disappears if the user reviews the quiz.  Is this a settings issue or is it that a user cannot retake a quiz in Cp after reviewing the correct/incorrect answers?
    I have the quiz preferences set as follows:
    Reporting:
    Enable reporting is checked
    Standard (SCORM 2004)
    Report Status:
    Pass/Fail
    Report to LMS as:
    Score
    Choose Report Data:
    Quiz Results Only
    Reporting Level:
    Interactions and Score (although this probably should be changed looking at the settings above)
    Settings:
    Quiz
    Name: Quiz Name
    Required: Pass Required
    Objective ID: (default)
    Interaction ID Prefix: (nothing entered)
    Settings:
    Shuffle answers (unchecked)
    Show Progress (checked)
    Allow Backward Movement (checked)
    Show Score at the End of the Quiz (checked)
    Allow User to Review the Quiz (checked)
    Pass or Fail:
    Pass/Fail Options:
    100% or more of total points to pass
    If Passing Grade:
    Continue
    If Failing Grade:
    Infinite Attempts (checked)
    Show Retake Button (checked)

    hi capSean
    i have the same requirement (if learner fails and wants to review, learner should be able to review, then retake quiz) and here's my work-around: instruct learner that if he/she wants to review first, THEN retake, he/she must rewind the course to the beginning.  this clears out the answers.  on my (SumTotal) LMS settings, i have to allow infinite attempts.
    best of luck,
    theresa

  • Why has my back button disappeared, I have to exit each time I want a previous screen.

    Why has my back button disappeared, I have to exit each time I want a previous screen

    I noticed you have ''Freeze (dot) com Net Assistant'' installed. This is considered by most security software to be malware since it changes your user preferences and feeds you ads. See http://www.mywot.com/en/scorecard/www.freeze.com
    Also, this Wikipedia article contains some info about it: http://en.wikipedia.org/wiki/W3i#History
    You should be able to remove it by going to Add-ons, then Extensions. If it's not there, then the free edition of Malwarebytes from http://www.malwarebytes.org/products/malwarebytes_free should be able to get rid of it for you.
    There are some screenshots of how you probably got it on your system here: http://www.emsisoft.com/en/malware/?Adware.Win32.Freeze.com+Toolbar
    (no need to purchase the software to remove it because as mentioned already, Malwarebytes should be able to get rid of it for you).

  • HT1349 i've been listening to a podcast but the pause button disappeared, how do i get it back?

    I've been listening to a podcast on my computer but the pause button disappeared, how do i get it back?

    I had this same issue after I upgraded. Have iTunes re-scan your library for iTunes Match (Click "Match" along the top row of your library -- Songs Albums Artists... etc.). After it finished re-scanning my library I could download songs again from iTunes Match.

  • Back and Forward button disappear in SAP CRM IC

    Hi Experts,
    I am facing a strange issue which i suspect has some dependency on the IE or Java .
    Please help me out if anybody has any clue on the same as to why is this occuring or what can be done to resolve it or even if there would be any logs registered from which I can find out what is the root cause.
    Issue :
    Sme agents when using the Interaction Center , finds their back and forward button disappears all of a sudden. There is no definite pattern happening, it could be like when they try to send outbound emails from a Service Request , all of a sudden the back and forward button goes away from the Email page.
    Most of the times, it happens when they are trying to send outbound emails. But some instances have been reported even when they are in some other screen in IC and all of a sudden their back and forward button disappears. So they have no option to go back or forward using these buttons and only work around would be to try to End the transaction using the 'End' button and start over all again.
    Appreciate any help if anyone has faced similar issue.
    Thanks
    Swapna.

    Hi,
    the implementation of the SN 1957612  has resolved the issue
    BR
    Damian

  • How do I stop my toolbar buttons disappearing every time I restart Firefox?

    My toolbar buttons disappear every time I restart Firefox 4.0.1. They used to disappear only every week or so. Then I tried the recommended fix at "http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox" dealing with file places.sqlite. Now they disappear every time I start, which is several times a day due to RAM usage sometimes approaching 1GB after a few hours. I am on Win 7 and have customized with tabs on bottom and to display the menu bar and put my buttons at top to save space. This is driving me insane. I have to re-customize the toolbars every time I open the browser. I did not have this problem with Ff 3.6. I have tried the safe mode and checked add-ons 1 at a time. Nothing changes except now it's every time instead of every week or so. I cannot switch to Chrome full time because they don't have all the add-ons I need for work. Please help.

    If you lose the toolbar customization then you do not have a problem with places.sqlite, but with the file localstore.rdf in the [[Profiles|Profile folder]].
    * http://kb.mozillazine.org/Corrupt_localstore.rdf
    Use the Google cache in case of problems accessing the MozillaZine KB (prefix links with cache:):
    *http://www.google.com/search?hl=en&ie=UTF-8&q=cache:http://kb.mozillazine.org/Corrupt_localstore.rdf

Maybe you are looking for

  • WINDOW 8.1 ON SLEEP MODE SHUTS DOWN

    Please i have been having issues with my Windows 8.1. I find it very difficult to put my system on sleep mode , when using this boot option my system automatically restarts itself and all unsaved information or documents is lost. How do i reset this

  • Motion crashes upon simple tasks since Mavericks update

    Greetings, since I updated to Mavericks Motion sometimes freezes upon very simple tasks - like calling the HUD and then trying to adjust text size (the text being the only layer in a freshly started project). That happend a couple of times on my MacM

  • Question about NOW function

    Hi, I'm trying to use the following PL/SQL statement: select now from dual; It should return the date/time, and it won't work. It works in another instance of HTMLDB that I have installed pointing to a different database instance, running the same ve

  • How do I get sync to bring my bookmarks to a android.

    Sync is storing between my laptops but on the android it syncs all my folders but they are all empty. I get no actual bookmarks.

  • REP-56098: wrong system name

    i don't know why this error appears when any users request a specific report, if a users request another reports it's executed ok. what can i do , and where i can find a help about errors in reports server�