By clicking the JButton getting another JPanel in place of before JPanel in

my program having two JButtons ,Two JPanels,one JFrame.when i click on JButton1 ,JPanel1 with some content will be opened in the JFrame.After clicking on JButton2 ,JPanel2 with some cotent will be opened on the same JFrame at the same place before where the JPanel1 will be displayed.
JButtons will be at the top.Below that in the same JFrame JPanels will be displayed
plz help me..................

plz help ..how to see the code that you sent

Similar Messages

  • How to place a JPanel at the center of another JPanel?

    Can anyone tell me how to place a JPanel inside another JPanel? The first JPanel consists of three JPanels each consisting of a label&textfield and are placed using BoxLayout. The second JPanel is a big blank screen. So, i would like to put the first JPanel at the center of second JPanel(horizontally & vertically). The problem is that i don't have any other component. So,if i try to use FlowLayout, i am able to put it at the center(horizontally, not vertically) only on the top edge. I tried to use BoxLayout. But, i couldn't(as i don't have any other elements). I tried to create some blank elements. But, they are messing up the elements of my JPanel. Any cluesssssssss??????????

    import java.awt.*;
    import javax.swing.*;
    public class CenteredLayout
        private JPanel getPanel()
            GridBagLayout gridbag = new GridBagLayout();
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.insets = new Insets(2,2,2,2);
            JPanel p = new JPanel(gridbag);
            addComponents(new JLabel("label 1"), new JTextField(8), p, gbc);
            addComponents(new JLabel("label 2"), new JTextField(8), p, gbc);
            addComponents(new JLabel("label 3"), new JTextField(8), p, gbc);
            JPanel panel = new JPanel(gridbag);
            panel.setBackground(Color.pink);
            gbc.anchor = GridBagConstraints.CENTER;
            gbc.insets = new Insets(0,0,0,0);
            panel.add(p, gbc);
            return panel;
        private void addComponents(Component c1, Component c2, Container c,
                                   GridBagConstraints gbc)
            gbc.anchor = GridBagConstraints.EAST;
            gbc.gridwidth = GridBagConstraints.RELATIVE;
            c.add(c1, gbc);
            gbc.anchor = GridBagConstraints.WEST;
            gbc.gridwidth = GridBagConstraints.REMAINDER;
            c.add(c2, gbc);
        public static void main(String[] args)
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(new CenteredLayout().getPanel());
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    }

  • I use Linkedin for my freelance jobs. When I add connections I face a problem. I just click on the option "CONNECT" and after clicking the page gets on the top.

    I use Linkedin for freelance jobs. When I add connections in Mozilla Fire fox I click on the links one by one. When I click on the link the page gets me on the top. if i work at the middle of the page or at the end of page,,,,page gets me at the top after each connection. Please let me know how can i fix this. I want to hold the page at the same position because page doesn't refresh. Just a jerk get it on the top. Please tell me any software or firefox option for this.................................
    Thanks.
    Shakil Niazi.

    update your coding here , only linkedin

  • Why do I have to click the go button after typing a URL? Before FF6 I could just hit enter.

    I just recently updated to Firefox 6. Before the update, I was able to type a address into the URL bar and hit return. Nice and easy. Now if I do this I get no response. To direct to a web page I have to move my cursor to click the go button. It's annoying and a waste of time. What happened here? Any way I can change things so I can just hit enter again?

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    * https://support.mozilla.com/kb/Safe+Mode
    If it does work in Safe-mode then disable all extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    * Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    * Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")
    In Firefox 4+ you can use one of these to start in <u>[[Safe mode]]</u>:
    * Help > Restart with Add-ons Disabled
    * Hold down the Shift key while double clicking the Firefox desktop shortcut (Windows)
    * https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • Click the icons, get marketing/examples. How does it work? Biztree-"Couldn't load setup panel (403)"

    I'm in ePrint center. I'm clicking on apps to potentially use.  A click only leads to marketing blurbs & examples.  Some of them have a settings button icon.  I click that & nothing happens except for an error message: "Couldn't load setup panel (403)." What do I have to click &/or otherwise do to make an app work, hopefully in under 15 seconds of clicking?

    Hi McAfrokee,
    The apps are utilized from the front panel of your printer. You can select the apps section, it launches the apps, then select the app and print content within.
    If I have solved your issue, please feel free to provide kudos and make sure you mark this thread as solution provided!
    Although I work for HP, my posts and replies are my own opinion and not those of HP.

  • "This website cannot be trusted" that is crazy. I was going through the Firefox "getting started" and click on a link to "Set your home page" and it seems to be telling me that I can not trust firefox. LOL. It is asking me to make an exception.

    <blockquote>Locking duplicate thread.<br>
    Please continue here: [[/questions/919957]]</blockquote>
    So I tried to go to my iGoogle page and it did the same thing. I am certain there is a button to fix this but i swear i do not know where it is?
    The support article also took me to "untrusted information"

    Sounds like you have a link hijacker installed which McAfee doesn't find for some strange reason. What I suggest you do is to go to [http://www.malwarebytes.org/ Malwarebytes] and download the free version of the program. Then after you install it, update it via the link (tab) you'll see at the top and finally run a complete system scan.
    It's possible McAfee didn't ask you to disable Windows System Restore. That Microsoft utility which is part of the operating system makes backups of all executables including malware unfortunately.
    To be sure, I'd advise you to disable it temporarily by right clicking My Computer, then go to Properties and click the System Restore tab. Then place a checkmark in the box which says "Disable System Restore on all drives" and then click Apply/OK. This will delete all your Restore points, but it's the only way to remove malware which Windows is inadvertently making backups of.
    It would be advisable to do that before you run a scan.
    Once the Malwarebytes scan terminates and has quarantined anything it finds, you can re-enable System Restore again by removing the checkmark.
    Sorry it took so long to respond to your question by the way.

  • Double click the icon (upper left) to close frame

    hi to all
    how can i close a JInternalFrame/JFrame if i will double click
    the upper left icon which can be found before the title of the
    frame
    i don't know that to put, or what kind of listener..
    plse someone help...
    thanks
    kent

    Use, if the intframe is closable,
    jitf.setDefaultCloseOperation(JInternalFrame.DISPOSE_ON_CLOSE);but, normally, it is the default behavior.
    Have you created your jitf with the "closable" property to "true" ?
    Denis

  • I can't download firefox. When I click on run, I get a window saying that the author is unknown. When I click on run in the new window, another window says the file is corrupt. What can I do about this?

    I want to have firefox as my default browser. As this is a new laptop, I hasve to download firefox. As per the instructions, I click on "run" to complete the download, but instead of completing the download, a window appears which says that the author is unknown. If I ignore the window and click on run, I get another window which says the file is corrupt and I can't finish the download and have firefox as my browser.
    I have windows 7 and explorer is the default browser and I want to change to firefox, but so far am being prevented from doing so. How can I successfully download firefox?

    It is possible that your anti-virus software is corrupting the downloaded files or otherwise interfering with downloading files by Firefox.
    Try to disable the real-time (live) scanning of files in your anti-virus software temporarily to see if that makes downloading work.
    See also:
    * http://kb.mozillazine.org/Unable_to_save_or_download_files

  • When I first open Firefox it is fine but if I open a second tab to search another site I get a white screen and have to continually click 'back', click the site link, white screen, back, click the link, white screen and so on.

    When I first open Firefox it is fine but if I open a second tab to search another site I get a white screen and have to continually click 'back', click the site link, white screen, back, click the link, white screen and so on.

    This can also be a problem with the files [http://kb.mozillazine.org/sessionstore.js sessionstore.js] and sessionstore.bak in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Profile Folder]
    Delete [http://kb.mozillazine.org/sessionstore.js sessionstore.js] and sessionstore.bak in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Profile Folder]
    If you see files sessionstore-##.js with a number in the left part of the name like sessionstore-1.js then delete those as well.
    You will have to redo App Tabs and Tab Groups after deleting sessionstore.js.
    See:
    * http://kb.mozillazine.org/Session_Restore

  • When I click on the + sign, I do not get another tab even though an additional tab WILL open if, for example, I click on a link in an e-mail or on a site.

    Before the latest upgrade, I could open a new tab by clicking on the + to the right of any open tabs. No more. Nothing happens. If I click on a link in an e-mail or on a website, however, a new tab will open. For example, if I get an e-mail from Facebook that says someone has posted and I click the link, I will get a new tab opened and Facebook will be there. Then I have both tabs open and can navigate on either with no problem. If I then click on the + sign, nothing at all happens. I am perfectly able to open Safari with Firefox running, and I can get multiple tabs going there with no effect on Firefox. That is, I can go back and forth.
    I am grateful for any help! Thank you.

    Extensions
    Produtools Manuals 2.1 Community Toolbar 3.21.0.1 ({b2bf7b3f-bf0b-4c48-aec6-f92c51be63e1})
    Open the Add-ons Manager by
    Pressing the '''Alt''' or '''F10''' key to bring up the tool bar.
    Followed by; '''Tools > Add-ons.'''
    Hot key; '''<Control> ''(Mac: <Command>)'' <Shift> A)'''
    On the left side of the page, select Extensions.

  • I forgot my security questions and when i click the link that is supposed to reset it with an email i never get an email. Is there another way or anything i might be doing wrong to reset it?

    help

    You've tried clicking the link again ? If you aren't receiving the email (you've checked the spam folder as well as the inbox on it ?) then you can contact iTunes Support / Apple to get the questions reset.
    Contacting Apple about account security : http://support.apple.com/kb/HT5699

  • Whenever I click the back arrow after sending an email (ie. ebay) firefox tells me it has to "resend" which means another email gets sent - why is this?

    nothing more to be said. this is very annoying

    You can avoid that by not going back to that page. You can click the arrow to the right of the Forward button or right click either B/F button to open the tab history list and go back to a previous page to skip that page.

  • I'm no longer getting Allow and Remember prompt. I have to manually click the red icon in the upper left to access it. How do I restore the automatic prompt?

    Yesterday I visited a site to which I often go, pingtest.net. Normally, when I visit that site, a thin horizontal bar appears at the top of the browser viewing frame. I do not recall what it says, but it stretches the entire length of frame, from left to right. On the right edge of the bar is an x, if I wish to close it. In addition, when this horizontal bar appears, I also get a box which is about six to seven times the height of the thin horizontal bar that appears over the left edge of the thin horizontal bar. This box stretches across the width of about a sixth or fifth of the width of the horizontal bar. It contains something like the following: Show All, Allow, Allow and Remember. I normally click the Show all option, and I normally select Allow Now for all options.
    Here's what happened yesterday: I went to pingtest.net, the horizontal bar appeared, and everything seemed normal. However I took no action. Instead, I changed my mind and decided to go to a different URL. My cursor was in the middle of the screen. I moved the cursor up to what I intended to be the URL field, in order to enter a new URL. Unfortunately I didn't move the cursor sufficiently. So, instead of clicking in the URL field, I clicked right in the middle of the horizontal bar. I HAVE NO IDEA WHAT I CLICKED BUT FROM THAT MOMENT TO THIS THAT HORIZONTAL BAR HAS NEVER RE-APPEARED. WHATEVER I CLICKED, IT APPEARS I INSTRUCTED FIREFOX TO NEVER PROVIDE ME WITH THAT HORIZONTAL BAR AGAIN!!!
    As a result, I am also no longer getting the grey box with the Show All, Allow, Allow and Remember options.
    How can I restore normal behavior, and get the normal horizontal bar and the normal box with the Show All, Allow, Allow and Remember options?

    We had another thread recently where the user clicked "Continue Blocking" and thereafter, Firefox never showed the infobar. I posted a way to clear the block so that the infobar would display once again. It's a little involved, but if it's going to keep driving you crazy, see: [https://support.mozilla.org/questions/1011980 reset plugin behavior].

  • Can not open iCloud on MBP? Want to PhotoShare. Set up in iPhone.   Go to System Preferences, click on iCloud, get the message "move to iCloud", sign in, click on open iCloud", sign in again, and get only FindmyPhone?

    Set up in iPhone.   Go to System Preferences, click on iCloud, get the message "move to iCloud", sign in, click on open iCloud", sign in again, and get only FindmyPhone? Thus, when I go to Iphoto to set up photo sharing, it says I have to have icloud account-go to sys preferences--then i go through the loop again?  Suggestions?

    jgtown wrote:
    Now I have to get my sign-in for mobileme to be the same as my sign-in for Itunes, etc. so I have only one Apple ID!
    You're not going to be able to: you can't merge accounts or transfer iTunes purchases from one Apple ID to another: but there is no problem about using two IDs.
    Use your ex-MobileMe email address (which is also an Apple ID) for iCloud for syncing email, contacts, calendars, bookmarks, and PhotoStream.
    Use your other Apple ID as before for iTunes, iTunes in the Cloud and iTunes Match.
    There's no conflict about doing this, and you won't even notice as Keychain will log you in with the correct ID in each case. It's also better security not to have your iTunes login also your email address, given the number of complaints about hacked iTunes accounts.

  • I have an iPod Classic and the latest version of iTunes. I make all my purchases on my computer, but when I try to click the "add to" option and transfer the songs to my iPod, it doesn't work. How can I get my songs from my computer to my iPod?

    I have an iPod Classic and the latest version of iTunes. I make all my purchases on my computer, but when I try to click the "add to" option and transfer the songs to my iPod, it doesn't work. How can I get my songs from my computer to my iPod?

    See this excellent user tip from another forum member turingtest2 outlining the different methods and software available to help you copy content from your iPod back to your PC and into iTunes.
    Recovering your iTunes library from your iPod or iOS device
    B-rock

Maybe you are looking for

  • Error in webdynpro(ABAP) application development

    Hi,        I am very new in webdynpro (ABAP) application development. I want to create some application based on webdynpro ABAP for few Z- Report. What is the prerequisite to develop a application based  on webdynpro( ABAP ) .Because when I am trying

  • Control key

    Hi, all , I had certain queries which need to be clarified ,given below- 1)Apart from controlling operations, what r the other purpose of control key?? 2) What is key figures and what is it function? 3)In calibration order, is it required to do TECO

  • Adobe Illustrator classroom in a book CD

    Does anybody have a copy of Adobe Illustrator Classroom in a book CD please? I have looked on ebay and they only sell copies with the books? If anyone can transfer the files over to me I can pay a couple of quid for their bother. Or if they know how

  • No wireless networks found

    Last night while browsing ITunes on my Touch the network was disconnected. I checked to see if the router was down, it wasn't. Tried connecting other wireless devices to the network and they got on. I even connected to my network with my wife's Touch

  • Connecting Win98 pc to Tiger

    I'm wondering what the trick is. I have 2 Win98 pcs that connect just fine to/each other and my Panther eMac (10.3.6) but they won't connect to my Tiger iMac (10.4.2). My network is running fine and all the other connections work without a hitch. Hav