Problem in panel  - its not appear

Hi to all;
Here there is three panels . First Panel has label , when you press it you will go to the second panel . In the second panel there is a boutton when you press it third panel must be appeared but it is not appear .
why this ? please show me the correct way .
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
public class TestPro extends JFrame {
    private JPanel panel = new JPanel();
    private JLabel label1;
    private MyMouseListener myMouseListener;
    private TestPanel testPanel;
    public TestPro() {
        myMouseListener = new MyMouseListener();
        testPanel = new TestPanel();
        label1 = new JLabel("Start");
        label1.setFont(new Font("Monospaced", Font.BOLD, 30));
        label1.addMouseListener(myMouseListener);
        panel.add(label1);
        getContentPane().add(panel);
    public static void main(String[] args) {
        TestPro testPro = new TestPro();
        testPro.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        testPro.setResizable(false);
        testPro.setSize(new Dimension(600, 600));
        testPro.setLocationRelativeTo(null);
        testPro.setVisible(true);
    private class MyMouseListener extends MouseAdapter {
        @Override
        public void mouseEntered(MouseEvent e) {
            super.mouseEntered(e);
            label1.setForeground(Color.red);
        @Override
        public void mouseExited(MouseEvent e) {
            super.mouseExited(e);
            label1.setBackground(Color.BLACK);
        @Override
        public void mouseClicked(MouseEvent e) {
            super.mouseClicked(e);
            panel.setVisible(false);
            getContentPane().add(testPanel);
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.Box;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
class TestPanel extends JPanel {
    private Box box;
    private JLabel label = new JLabel("New Panel");
    private JButton button = new JButton("Go>>>>>");
    private MyactionListener myactionListener;
    private AnotherPanel anotherPanel;
    public TestPanel() {
        myactionListener = new MyactionListener();
        anotherPanel = new AnotherPanel();
        box = Box.createVerticalBox();
        box.add(label);
        button.addActionListener(myactionListener);
        box.add(Box.createVerticalStrut(5));
        box.add(button);
        add(box);
    private class MyactionListener implements ActionListener {
        public void actionPerformed(ActionEvent e) {
            setVisible(false);
            anotherPanel.setVisible(true);
            add(anotherPanel);
import java.awt.Font;
import javax.swing.JLabel;
import javax.swing.JPanel;
class AnotherPanel extends JPanel {
    private JLabel label=new JLabel("Another panel");
    public AnotherPanel() {
        label.setFont(new Font("Monospaced", Font.BOLD, 30));
        add(label);
}Thanks in advance .
Edited by: 804610 on Oct 22, 2010 6:29 PM

Thanks for your reply .
but in class TestPanel i did this :
    private class MyactionListener implements ActionListener {
        public void actionPerformed(ActionEvent e) {
            setVisible(false);
            anotherPanel.setVisible(true);
            anotherPanel.revalidate();
            anotherPanel.repaint();
            add(anotherPanel);
    }but also the anotherPanel not appear when i press button . why?
hint: I want when i press button the TestPanel disappear .
thanks
Edited by: 804610 on Oct 22, 2010 7:03 PM

Similar Messages

  • Hello, i own an i7 all in one mac. I tried to partition him using bootcamp but didn't have mac os cd neither mac instalation. the problem i am dealing now its that i cant go back to OS partition since its not appeared when i restart c and no win drivers

    I tried to partition him using bootcamp but didn't have mac os cd neither mac instalation. the problem i am dealing now its that i cant go back to OS partition since its not appeared when i restart c and no win drivers to have a properly running system. I've thought as an option to re-download boot-camp and run the instalation from windows partition and see if i can repair it that way, didnt try yet thought just in case anyone has a better prposition or dealed with the same problem

    Take it to your local Apple Store or AASP, it's covered by a 1 year hardware warranty. If you have AppleCare then give them a call but I'm pretty sure they will advise the same. If you have not purchased AppleCare yet please do, this will extend the warranty to 3 years however it MUST be purchased within the first  year of ownership. Let it go 366 days and you are out of luck. AppleCare will also include telephone support too.
    Good luck.

  • CC 2014 nik efex - My Nik Efex filters are not working in Photoshop CC 2014 - they appear under plug-ins and seem to work, but after running and clicking okay, no new layer appears - seems to have no effect.  The separate menu panel does not appear either

    My Nik Efex filters are not working in Photoshop CC 2014 - they appear under plug-ins and seem to work, but after running and clicking okay, no new layer appears - seems to have no effect.  The separate menu panel does not appear either.  Help with this?

    BINGO !!!!
    Thanks so much Woodsroad. I had the exact same problem with my Dell Windows 7 64 bit with AMD Radeon 6700 Video card.
    All the video tests passed with flying colors.
    The sniffer rename trick fixed the problem.
    Thank goodness for the internet!

  • Apps panel does not appear, "Install Adobe Apps" not working

    Hi,
    I would like to download Photoshop CC (first the trial version) but after downloading Creatice Cloud Desktop, the Apps panel does not appear at all. If I click on the "install adobe apps" tab nothing happens. I have tried everything that was written on the forum but nothing seems to work . I have also re-installed the programs several times.@
    Sara

    Ciao guys, in the end I tried everything in this post but nothing worked.
    I managed to solve the problem through this: creative cloud is blank window why? renaming that opm.db file but in the "Program Files (x86)" folder (I prevously used the "program files" one.
    Thanks
    Sara

  • My iphone 4 does not appear in my(windows 7) lap top, when i connect i can hear the sound of usb connected, but its not appear in the itunes or computer, and its not charging as well, bit confusing

    my iphone 4 does not appear in my(windows 7) lap top, when i connect i can hear the sound of usb connected, but its not appear in the itunes or computer, and its not charging when i connected to the laptop as well, bit confusing, help please

    Take a look at this link, http://support.apple.com/kb/TS1538

  • The graphic HTML signature panel does not appear in my Mac mail

    The graphic HTML signature panel does not appear in my Mac mail. I have inserted the signature after reading on the forum. But the images do not download - the rest of the text in the signature is in place - just the logo and the baseline which is a graphic file does not download.  Please help.

    Hi, are the pics at a remote location, or on your Mac?
    Have you tried drag & dropping the graphics on the signature window?

  • Flash element panel does not appear when Flash is selected in DW3

    In DW3 (Win7) After creating several slide shows using image viewer and months later when I want to edit the image viewer.. When I click on the flash slideshow that I created in image viewer in order to edit it and the Flash Elements panel does not appear on the right as it did before. I have the Tags panel open and it has changed to Flash elements in the past but it is no longer appearing. This happened with a friends DW3 also.

    DW3 or DW CS3?

  • Ive just opened up my brand new 5th gen, 32g, blue Ipod Touch. I turned on the power and started to use it until the battery went off. The problem is that its not charging. Im really starting to get frustrated please help!

    ive just opened up my brand new 5th gen, 32g, blue Ipod Touch. I turned on the power and started to use it until the battery went off. The problem is that its not charging and i wouldnt know if it was charging or not because the screen

    Try:                                               
    - iOS: Not responding or does not turn on           
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try another cable                     
    - Try on another computer                                                       
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
      Apple Retail Store - Genius Bar              
    ANd
    Not Charge
    - See:    
    iPod touch: Hardware troubleshooting
    iPhone and iPod touch: Charging the battery
    - Try another cable. The cable for 5G iPod (lightning connector) seems to be more prone to failure than the older cable.
    - If a 5G iPod               
    Iphone 5 lightning port charging problem - SOLUTION!
    - Try another charging source
    - Inspect the dock connector on the iPod for bent or missing contacts, foreign material, corroded contacts, broken, missing or cracked plastic.
    - Make an appointment at the Genius Bar of an Apple store.
      Apple Retail Store - Genius Bar

  • My preset panel does not appear HELP!

    I don't know why but when i start up lightroom, the preset panel on the left does not appear and the quick develop on the right has arrows to change variables not sliders. The only way i can use presets are to right click and choose them manually and this is very tedious. How do i get back the preset panel on the left so i can make things easier for myself? Also how do i get back the sliders for the quick develop side as it currently only has arrows to click.
    I have adobe lightroom 3.3 by the way
    Please and Thanks

    omg i was....now i feel stupid, ive been uninstalling and reinstalling to fix it LOL
    thank you so much!

  • I just purchased a moive from  itunes and its not appearing in my downlaonds

    i dont know what to do now, i purchased this movie and its saying that i did so but t just disappeared, it did not auto download. and it does not appear in my downloads either

    You probably need to delete your iTunes media downloads folder.  From http://support.apple.com/kb/TS3297:
    "Error -50," "-5000," "8003," "8008," or "-42023"
    These alerts occur due to timeouts or conflicts trying to write a file during download.
    If you encounter this issue while accessing iTunes Store:
    See iTunes 9: "One Moment Please" or "Error (-50)" message when accessing iTunes Store
    If you encounter this issue while while downloading something from the iTunes Store:
    Delete your iTunes Downloads folder, located in:
    Mac OS X:
  ~/Music/iTunes/iTunes Media/Downloads   Note: "iTunes Media" may appear as "iTunes Music. Also, the tilde (~) refers to your Home directory.
    Windows Vista:
  \Users\username\Music\iTunes\iTunes Media\Downloads\
    Windows 7:
  \Users\username\My Music\iTunes\iTunes Media\Downloads\
    Windows XP:
  \Documents and Settings\username\My Documents\My Music\iTunes\iTunes Media\Downloads\
    After locating your iTunes Downloads folder:
    Quit iTunes.
    Delete the Downloads folder on your computer.
    Open iTunes.
    Choose Store > Check for Available Downloads.
    Enter your account name and password.

  • New Creative Cloud Panel Does Not Appear!

    My application manager has updated all programs to CC versions but the Creative Cloud panel it self does not update to appear. If I go to settings, it says Version is 1.0.500.16 x64. If I push the "Check for Updates" button on settings windows, it only says no updates available. If I go to https://creative.adobe.com/products/creative-cloud?cc_source=files_sidebar_promo and push "Download" button it only starts old Application manager which brings only application list wich is ofcourse all up to date.
    This all happend only in my Laptop. Earlier when I updated my desktop computer, everything goes just fine and CC panel installed correctly. Following screenshots explains problem visually.

    As per screenshot i am asuming you are using Windows Operating System.
    Please perform the following steps:
    WIN 7 and 8 (64 bit):
    Rename OOBE to OOBE_old located at C:\Program Files (x86)\Common Files\Adobe 
    Relaunch the Browser 
    Go to https://creative.adobe.com/products/creative-cloud 
    Sign in with Adobe ID and password and download CC desktop app.
    WIN 7 and 8 (32 bit):
    Rename OOBE to OOBE_old located at C:\Program Files\Common Files\Adobe 
    Relaunch the Browser 
    Go to https://creative.adobe.com/products/creative-cloud 
    Sign in with Adobe ID and password and download CC desktop app.

  • Adobe native control panel does not appear in system preferences

    I have flash 10,3,181,34 installed on my mac running osx lion.
    As other people i have trouble with flash and lion. However i also have problems with the "fix".
    I cannot see the native control panel when i open system preferences. it is not in the "other" group or any other group.
    any ideas?
    Thank you for your help

    Reset the SMC.
    Barry

  • Problem With Profile Pics Not Appearing in iMesage

    Why is it that I can have a profile picture added to a person in my contacts list, yet that picture may or may not show up in a conversation in iMessage?  For some of my contacts the picture does appear, and for some it does not.  I'm having this issue on my iPad Air and my iPhone 4.

    On the iPad you will see pictures in the left-hand panel for each message thread but this feature is not implemented on the iPhone.
    The Mac, in addition, shows the contact picture on each individual message.

  • ExtjS Panels - Does not appear.

    Hi All,
    I have apex 3.2 with extjs 2.2 working correctly. All my panels logo, menu and work areas appear. We have upgraded to Apex Application Express 4.1.0.00.32 and now the application just hangs. I was receiving errors in firebug but after moving the #HEAD# tag to after all the javascript inclusions all errors have been resolved but now the app just hangs. I have a report region which displays incorrectly but none of the extjs panels display.
    See related previous thread to resove #HEAD# issue -- apex.jQuery is not a function
    Any help and pointers, notes to previous posts welcome.
    Rgds
    Praj.

    I went and downloaded the ipod updater and the new version of itunes to see if that would help but it said ipod updater error and i redownloaded it and the same thing happened...

  • Flash Pro CS6 "Actions Panel" will not appear

    I'm using CS6 and when I open Window->Actions, I see the Actions Tab but not the "Actions Panel."   I've looked all over the place and can't get it to open.  The "Actions Panel" when working with older scripts in AcxtionScript 2 where there are a bunch of programs added to many different frames.  Please tell me how I can open the "Actions Panel."  Thanks, Allan 
    [personal information removed... Mod - https://forums.adobe.com/docs/DOC-3731]
    [This is an open forum, not Adobe support, please do not post personal information]

    Thank you for answering my question.  When I follow your directions, I still don't see the Actions Menu.  According to
    http://helpx.adobe.com/photoshop/using/actions-actions-panel.html it should appear in the middle in the Essentials Workspace layout.  All I get are the following tabs [color-swatches] and [Align-Info-Transform] and [Code Snippets-Components-Motions Presets] and [Project] in the middle section.  With [Properties-Library-Actions] on the left.  [Timeline-Motion Editor] on the bottom.  And the [.fla and .as] open in the top left. 
    I can't find the Actions Menu.  The only reason that I know that the Actions Menu exists is that I had to work on another guys PC for a morning, and there is was! I is a bug help with older ActionScript 1/2 projects.
    I appreciate your help, Allan

Maybe you are looking for

  • My Satellite does not turn on

    Hey, I've a satellite M40 which does not power on. I had a message on a blue screen saying: DRIVER_IRQL_NOT_LESS_OR_EQUAL and it shut down right after. When I switch the laptop on the power light flash orange for a second. After 3or 4 other seconds i

  • What do I need to install a second HD on HP Pavilion DV7

    A friend had purchased a HP Pavilion DV7 -6B50EB that came with 1 TB hard disk. On the PC there is an empty slot for a second disk. What is needed to install the second hard disk ? The slot contains a HD container but there is no connecting wires to

  • 2009.08 official snapshots

    Hey guys and girls. We cannot post this on the mainpage (yet) but we don't want to hold you back, so we want to introduce you to the official 2009.08 images. These images are the first fruits of our new arch-releng build environment on the sevenL ser

  • Color Picker with Pantone conversion

    In Photoshop you can sample an area with the eyedropper, click on the swatch in Color Picker and have it give you the PMS equivalent from the "book" list. I would love the same feature in Illustrator. It makes more sense to have the spot color conver

  • How to disable a Column for a particular row in Advanced Tables

    Hi All, We are using an Advanced Table for search criteria. Our requirement demands to disable a column (we are using messagechoice item in that column) for only first row. We use standard Add Another Row functionality to add the rows.For the remaini