Gui labels and buttons not showing...

I am using Java to create a gui and so far I have everything working.
But there is a section of code thats not working out and Ill post the whole file here (not very big) to let you guys see whats going on. The issue lies in the action listner where I state "if a text feild is empty, display the option pane, else show the following" and its not showing the labels and buttons.
Help?
package student.information.search;
import javax.swing.JFrame;
import java.awt.GridBagLayout;
import javax.swing.WindowConstants;
import java.awt.Rectangle;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import java.awt.ActiveEvent;
import java.awt.Frame;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JTextField;
import javax.swing.JButton;
import student.information.readonly.ReadOnlyStudentForm;
public class StudentSearch extends Frame implements ActionListener
   JTextField textField = new JTextField();
   JFrame frame = new JFrame();
   JPanel contentPane = (JPanel) frame.getContentPane();
   GridBagLayout gridBagLayout = new GridBagLayout();
    public StudentSearch()
        gridBagLayout.columnWidths = new int[]{20, 0, 12, 137, 17};
        gridBagLayout.rowHeights = new int[]{26, 0, 6, 0, 20};
        gridBagLayout.columnWeights = new double[]{1, 0, 0, 0, 0};
        gridBagLayout.rowWeights = new double[]{0, 0, 0, 0, 1};
        contentPane.setLayout(gridBagLayout);
        JButton button = new JButton();
        button.setText("Search");
        button.addActionListener(this);
        contentPane.add(button, new GridBagConstraints(3, 3, 1, 1, 0.0, 0.0, 13, 0, new Insets(0, 0, 0, 0), 0, 0));
        textField.setColumns(8);
        contentPane.add(textField, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0, 768, 2, new Insets(0, 0, 0, 0), 0, 0));
        JLabel label = new JLabel();
        label.setText("Student Seach");
        contentPane.add(label, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, 256, 0, new Insets(0, 0, 0, 0), 0, 0));
        frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        frame.setTitle("Student Search");
        frame.setBounds(new Rectangle(500, 0, 500, 320));
        frame.setVisible(true);
   public void actionPerformed( ActionEvent arg0)
        if (textField.getText().equals(""))
          JOptionPane.showConfirmDialog(null, "Please enter a value in the search feild", "Error", JOptionPane.OK_CANCEL_OPTION); 
        else
           //Show the text fields here and the user information. 
             *  While there are students for this search, change the text fields to Name, Last Name and ID and have a button called
             *  View that when clicked allows for you to view all that students information.
            JLabel firstName = new JLabel();
            firstName.setText("Label");
            contentPane.add(firstName, new GridBagConstraints(5, 5, 1, 1, 0.0, 0.0, 768, 0, new Insets(0, 0, 0, 0), 0, 0));
            JLabel lastName = new JLabel();
            lastName.setText("Label");
            contentPane.add(lastName, new GridBagConstraints(3, 5, 1, 1, 0.0, 0.0, 256, 0, new Insets(0, 0, 0, 0), 0, 0));
            JLabel studentID = new JLabel();
            studentID.setText("Label");
            contentPane.add(studentID, new GridBagConstraints(1, 5, 1, 1, 0.0, 0.0, 256, 0, new Insets(0, 0, 0, 0), 0, 0));
            JButton viewStudentInformation = new JButton();
            viewStudentInformation.setText("Search");
            viewStudentInformation.addActionListener(new ActionListener()
                    public void actionPerformed(ActionEvent e)
                           //For viewing individual student information
                            new ReadOnlyStudentForm();
            contentPane.add(viewStudentInformation, new GridBagConstraints(7, 3, 1, 1, 0.0, 0.0, 13, 0, new Insets(0, 0, 0, 0), 0, 0));
}

In general when adding or removing components for a visible GUI you need to use:
panel.add(...);
panel.revalidate();
panel.repaint();

Similar Messages

  • Menu and Buttons not showing up!?!

    OK. I was trying to burn a iDVD project on my dual G5 desktop w/iDVD5. I would get "there's an error while rendering". After fiddling with it for a day and getting no where, I switched to my laptop (G4/1.25ghz/10.4.8) with iDVD6.0.3. I started to re-assemble the project and the Themes button appears with the themes, the Media button appears with the media, but both the Menu and Buttons buttons show up with nothing but a empty white area! I need to reposition some buttons, but I can't.
    Please help.

    This frequently helps solve some problems. Quit iDVD. Search for the file named com.apple.iDVD.plist and trash it. (A new one will be created next launch of iDVD.) Or look in: User/Library/Preferences. This may solve project loading errors too. Restart and use Disk Utility to Repair Permissions.
    You'll need to reset some Preferences.

  • [svn:fx-trunk] 12057: Label (and RichText) will show text as tooltip if truncated and new showTruncationTip flag is set to true  ( defaults to false because Label is often used in skin that have their own tooltip logic ).

    Revision: 12057
    Revision: 12057
    Author:   [email protected]
    Date:     2009-11-20 11:22:05 -0800 (Fri, 20 Nov 2009)
    Log Message:
    Label (and RichText) will show text as tooltip if truncated and new showTruncationTip flag is set to true (defaults to false because Label is often used in skin that have their own tooltip logic).
    QE Notes: New API (showTruncationTip)
    Doc Notes: New API (showTruncationTip)
    Bugs: SDK-23639
    Reviewer: Gordon
    API Change: Yes
    Is noteworthy for integration: Yes
    tests: checkintests mustella/gumbo/components/Button mustella/gumbo/components/Label
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-23639
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as

    Hi blabla12345,
    (untested and without warranty)
    replace this line:
    const sSaveCUBE = "CUBE";
    with this:
    const sSaveCUBE = "cube";
    Have fun

  • After upgrading my iPhone 4S to iOS6, my Find My Friends app no longer links to my Contacts and does not show contact names. It only shows e-mail addresses and does not link up to the corresponding email address in my Contacts. How can I fix this?

    After upgrading my iPhone 4S to iOS6, my Find My Friends app no longer links to my Contacts and does not show contact names. It only shows e-mail addresses and does not link up to the corresponding email address in my Contacts. How can I fix this?

    I am also having problems with a site I am building. No matter what websafe font I use it displays as New Times Roman in FireFox. The correct fonts show in both IE9 and Chrome.
    In addition, text shifts in FireFox. I have to position other text objects farther and farther apart as I go down the page or they start to overlap. Nav buttons and other images also have to be positioned in the wrong place for them to be in the correct place when the page is opened in FireFox. FireFox should display pages correctly by default. I can't expect th average user to have to tweek his/her settings to display my site.
    I have been recommending FireFox on my website as the best browser. I might have to change that and abandon FireFox myself.

  • Fax and scan not showing network contacts

    Was bumped from the office Q/A forum
    http://answers.microsoft.com/en-us/office/forum/office_2010-outlook/fax-and-scan-not-showing-network-contacts/4bf79dbd-a2cc-4a96-a8cd-bbdb01746a5c
    Just going to jump right to it, let me get the picture painted
    windows 7 x32 office 2010 (also tested on office 2013
    shared contact book from a networked pc
    I open the fax and scan click to and/or contact buttons the shared contacts show up just fine
    setup and activate an email account Imap/POP
    repeat the process and only the outlook contacts show up
    remove the email profile and the contact are back
    all pc are domained 
    i have 5 other pc that don't have this issues
    4 win7 x64 offices 2013
    1 win7 x32 office 2013 (hosting the address contacts)
    From what I can find most are having the opposite outcome that the outlook contacts are not showing up.

    Hi Sean,
    As per the description, I understand that a shared contact book cannot show in Windows Fax and Scan. There is not so much we can do on Office side, I'd suggest you check on Windows client side.
    This is the forum to discuss questions and feedback for Microsoft Office client. I would suggest you to post in the forum of
    Windows 7 as Windows Fax and Scan is a Windows feature:
    https://social.technet.microsoft.com/Forums/windows/en-US/home?category=w7itpro
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    Regards,
    Ethan Hua
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Why isn't the edit button not showing in my ESX24 sampler?

    why isn't the edit button not showing in my ESX24 sampler?

    Is that during installation when you see the two icons.. the one on the left looking like a Garageband guitar icon, the one on the right like the Logic Pro platimum record icon?
    Yes.. that one.. with the choice to click on which option you want/are coming from...
    p.s. I'll probably aquire a Mac Mini this fall then upgrade.... I mean repurchase!
    I think I managed to grab one of the last of the 2011 refurb'ed MMS's.... at that super low price Apple were selling them for... before they bumped it up and now, they seem to have none left at all at any price
    However, just in case, I have found this site really useful at keeping track of Apple's refurb stock... and pricing
    http://www.refurb.me/us/

  • TS2972 why is the import button not showing at the button right hand corner of iTunes?

    why is the import button not showing at the bottom right hand corner of my ITunes page.  I am trying to transfer files from my home share library onto a new computers library.

    See if it isn't hidden under the View menu. iTunes- Turning on iTunes menus in Windows 8 and 7.

  • My new purchases will not sync into my playlist and get and will not show up on my iphone playlist of the same name, and I just tried to sync a new cd into my library and it is not showing up on my iphone.

    My new purchases will not sync into my playlist and get and will not show up on my iphone playlist of the same name, and I just tried to sync a new cd into my library and it is not showing up on my iphone.

    Hello there, Capricious13.
    There are great pointers in the following Knowledge Base article. Depending on where you see the content and where you want to get it to, this should guide you to putting it in the right place:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    http://support.apple.com/kb/ht2519
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro D.

  • Hundreds of my iPhoto pictures will not be copied and will not show when I double-click on them.  When I do in iPhoto an exclamation surrounded by a triangle appears.  Though I can see the picture in the small tiles below it will not expand.

    Hundreds of my iPhoto pictures will not be copied and will not show when I double-click on them.  When I do in iPhoto an exclamation surrounded by a triangle appears.  Though I can see the picture in the small tiles below it will not expand.  I also cannot attach any of these pics into an e-mail or into any other file.  I have already went through all 3 Repair options and when that did not solve it went through a complete Rebuild.  Any Help?!  Any Suggestions on how to fix this?!  I have spent almost 2 days now going through all of the published help.
    I have backups going back 6 months - I have not had the real need to check every album before - but - all of my backups also have this same problem.

    The triangle with the ! indicates that the connection between the thumbnail and the orginal is missing - this can be caused by many things including database corruption and user action emoving the originals photos on urpose or by accident
    If the database is corrupted then rebuilding is the solution - backup and depress the option and command keys, launch iPhoto and rebuild your database  --  if the iPhoto rebuild does not cure the problem then download iPhoto Library manager and use its rebuild command which creates a totally new library leaving the existing one untouched
    If you have deleted the photos then you need to start over with a new library and import the photos you have not deleted into it
    You can select one of the problem photos and use the reveal original in finder commander (file menu) to see if the original is there - if it is a finder window will open showing it
    LN

  • Apple TV won't connect to iTunes and does not show up in my devices list in iTunes.

    My older model Apple TV won't connect to iTunes and does not show up in my devices list in iTunes.  I have two Apple TVs in my house and I can't imagine that this is part of the problem but I mention it just in case.  My other Apple TV is brand new and it connects to iTunes just fine.  I've tried most of the "fixes" and one says to Force Sync but I can't since Apple TV isn't in my device list.  Another "Fix" said to Navigate the Apple TV to Settings --> Downloads --> Check for Downloads, but when I tried that there was no option for "Downloads" under the Settings Heading.  I'm at a loss.  Please help.  Could this be an issue with too many authorized devices?  We have three iPads, two iPhones, laptop, desktop, two Apple TVs, and an iPod and most of them are syncing the same music playlists and whatnot...  have I run out of rope?

    hi, just posting to everyone in general..its not you, or your apple tv, it is itunes.
    ok, ive had the exact same issues for weeks now, as with everyone i had done the lastest upgrade and no longer could see/sync my gen 1 appleTV.........so, i removed the upgrade and went back to the prev version, even though it was showing in my prefs under appleTV, it still wouldnt show in the side panel under devices....i gave up.
    This week i was determined to get it to work!  So i started from scratch, totally removed itunes and started back with version 9 and upgrade each version from there, i had no luck, ic clicked find appleTvs but it wouldnt....however i just d/l version 9.2.0.61 and BINGO!. No sooner has it opened and up popped the side panel devices list, showing my appleTV..all ready to be synced etc. I immediately panicked of course haha..and set it all up and its working perfectly.
    ...Only catch now is that this older version will not be compatiable with my iphone, which i do keep music on...seems we cant win. grrrrrrrrrrrrrrrr   this will be the same for all the latest apple products.
    Apple needs to allow more than one version of itunes per pc OR perhaps they could get their act together and include all of the millions of APPLETV GEN1  owners in there latest upgrading..after all, THEY made the product and THEY do sell the movies/tv shows, perhaps they could stop making all the upgrade all about the music only!......on which i might add why not incluse movies/tv shows in icloud! yet another upgrade that should be included in the APPLETV  GERNERATION 1!..yes we do  still exist!
    at the very least, im happy ive managed to get all my movies etc onto the apple tv, where ill keep them and from now on d/l directly onto my apple tv. I usually d/l to my laptop and then send them to the appletv but while trying to get all this sorted i did a test, i d/l a movie  using my appletv hoping it would somehow let itunes "find" it and getting it to show up in my device list, but it didnt work,  however it did sync/send the movie to itunes..  so at least i could save a back up copy.
    good luck trying, as i said this has been weeks and this is the only solution ive found so far....and going through these forums its obviouse its itunes thats the issue, NOT Our apple tvs.

  • My hard drive icon is gone from desk top and does not show up in spotlight or finder searches!

    Hi there
    recently my hard drive icon has disappeared from my Macbook Pro (10.7.4) desk top and does not show up in spotlight or finder searches! I have tried several fixes posted online for earlier operating systems with no luck.
    Also, when I connect my external hard drive the icon does not appear on the desl top nor in the finder either, making looking for documents impossible.
    Help!!!
    Thanks in advance!
    Marni

    In "finder" click "finder" then "preferences" and navigate to the "general" tab. 
    Select which items you would like to have show on your desktop.

  • Trying to upgrade from OS9 to 10.2.3, get as far as "select a Destination"  the installation stalls and does not show any destination disks

    I have a Power Mac G4, it has OS 9.  Imam trying to upgrade to OS 10.2.3 (Jaguar).  It is going smoothly until I get to the "Select Destination"  screen.  It stalls there and does not show any disks to choose from.
    Any ideas?
    Thanks. Abe Oliver

    Hello Abe,
    If it's a Digital Audio or earlier, you need to install a Firmware update first...
    As explained in "Mac OS X 10.2 Welcome and Install Manuals" and "Mac OS X Welcome and Install Manuals", you may need to update the firmware on your Macintosh computer prior to installing Mac OS X 10.2 or later. The following table lists the firmware updates that are available for Apple products that can update to Mac OS X 10.2 or later.
    http://support.apple.com/kb/HT1395?viewlocale=en_US
    Power Mac G4
    Firmware Update
    Download Document No.
    Power Mac G4 (Mirrored Drive Doors 2003)
    no update needed
    Power Mac G4 (FW 800)
    no update needed
    Power Mac G4 (Mirrored Drive Doors)
    no update needed
    Power Mac G4 (QuickSilver 2002)
    no update needed
    Power Mac G4 (QuickSilver)
    no update needed
    Power Mac G4 (Digital Audio)
    Power Mac G4 Firmware Update 4.2.8
    120068
    Power Mac G4 (Gigabit Ethernet)
    Power Mac G4 Firmware Update 4.2.8
    120068
    Power Mac G4 (AGP Graphics)
    Power Mac G4 Firmware Update 4.2.8
    120068
    Power Mac G4 (PCI Graphics)
    no update needed
    Power Mac G4 Cube
    Power Mac G4 Cube Firmware Update 4.1.9
    75129

  • "record enable" buttons not showing up in Garage Band 10.0.3 (I have selected "show record enable"- a space in the track header opens up, but the button is not present.  Same with "input moniter".

    "record enable" buttons not showing up in Garage Band 10.0.3 (I have selected "show record enable"- a space in the track header opens up, but the button is not present.  Same with "input monitor".

    Look at all the posts in the forum from users with similar problems, it happened with the last Logic update.

  • BB Z10 BBM Group updates and notifications not showing up in Hub?

    BBM Group updates and notifications not showing up in Hub? The notifications are turned ON in Group settings. And all BBM notifications are enable in the Hub, still nothing shows up. Picture comments, addition, status updates simply dont show up. My device is on 10.0.10.58. 
    Any workaround? 

    vijaymalhan, in your Hub settings > Hub Management, do you have BBM set to ON?
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • HT1933 Downloaded a movie and its not showing up in purchased

    I downloaded a movie and its not showing up in the purchased file

    It should be in your Library under Movies

Maybe you are looking for

  • HT3819 My wife and I each have our own Apple ID's. Can we share music we purchase with each other?

    We each have our own iTunes libraries but would like to share some music that we purchase in iTunes. Can this be done? Peter

  • How can I Fetch the error message from a OAF page

    Hi, A confirmation message is coming on the page,I want to catch the error message and depending on its value want to add some validation. Is that possible to fetch the error message from the page?

  • Call procedure with MS SQL from linked Oracle server

    I have a procedure on a remote server that I can call from SQL*PLUS set serveroutput on declare rez varchar2(99); msg varchar2(99); begin radar.test('AL25',rez,msg); dbms_output.put_line('Rez='||rez); dbms_output.put_line('Msg='||msg); end; it gives

  • Using I-Tune purchases in Window Media Player

    I use Windows Media Player the central location for maitaining my music library. None of my purchases from ITunes end up in WMP, and when I try to open them with WMP, I get an incompatable file message. I am also at a loss when it comes to loading It

  • OBI LDAP SSL

    Hi all, I'm trying to to log in OBI by a LDAP using SSL.We can log using LDAP, we configure everything in Administration Tool and it works fine. But when we mark the SSL option it doesn't work. the error is: image . How can i solve this error? Where