Removing and adding panels to a jframe

i have tried using remove all to remove a panel which is on my mainpanel which is on the jframe. when i do though, only the area where the menu was is removed. The components on the frame are not accessible. i want to then add another frame. this does not seem to work. i have tried using removeAll(), validate(), repaint(). i am probably not using them correctly or in the right order, so can anyone help me out?????????

If you have added the JPanel to the JFrame and the components to the JPanel the removeAll() should work.
public void actionPerformed(ActionEvent e){
   if(e.getSource()==myButton){
       content.removeAll();
       content.add(panel2);
  }

Similar Messages

  • No Start Menu, removed and added User Account then no "Built In" Apps - Build 1049

    So quick history, was having problem with start menu not working under build 1044 for the second user I'd added to the machine (Microsoft account). Rebuilt using "Remove everything and reinstall windows". Seemed to resolve the problem for the newly
    added user and was still working under the original user (also Microsoft Account).  Then along came build 1049 and now the same start menu issue occurred for the original user account.  So, as both were setup as admins, removed the original
    user account, restarted, checked all data removed and added the account again. 
    First attempt added the account as a local account then added the Microsoft account after login, result = start menu working but no "built in" apps (store beta, insider app etc).
    So removed account again and added again, this time using Microsoft account immediately, logged in and exactly the same result.
    Any ideas how to resolve?

    You cannot use the Start Menu logging in as anything that would be in the BUILTIN\administrator group on the computer.  I had the same problem when I added the machine to a domain, thus domain admins is in the BUILTIN\Administrator group.
    The reason being that the Windows 10 Start Menu is an appxpackage, and you can't run appxpackages using the built-in administrator account.  As is the case for example with Windows Store.  It doesn't however give you a warning message, you
    just click on the windows button and nothing happens.
    This is just total madness imv.  It kind of made sense when all the appxpackages where apps, but now they include parts of the OS, the OS is essentially non-functional when you log in using anything in the BUILTIN\ administrator group.
    If you really want to blow your mind, go into PowerShell and run the command: get-appxpackage|remove-appxpackage
    If you run that on Windows 8.1 it will remove all the bloatware apps for the logged on user.  Run it in Windows 10 and it removes various parts of the OS for that user as well, such as the Start Menu!

  • Voicemail not working - after removing and adding Dialplan

    Exchange 2013
    Lync 2013
    I had a UM dial plan configured and it was working properly.   I removed that plan and added a new one.  The new one does not work.
    When ever you leave a Voice-mail for a user, they never get it.  If the user logs in, they still have access to old voice-mails that were left before the UM dial plan was deleted and a new one created.
    My assumption is that when you activate the user for UM, it is attaching back to the existing information, instead of using the new dial plan.  Anyone have any thoughts on how to stop this?   
    Is there a way I can just purge all UM information and start over?
    Thanks,
    Rogan

    I did, as far as I can tell the new dial plan is working.
    Currently, only I am enabled for UM in the environment.  If you call my extension, you are able to leave a VM.  I never get a missed call notification or the Voicemail.  If I manually log into my Voicemail, I have no new voicemail and only
    old ones that were left before this new UM plan was created.
    I did remove UM from my account and re-add it with the new one, that did not solve the problem.  
    Where are the VM that are being left now going, if not into my mailbox.
    Does deleting a UM remove any associated voicemails?  Should it?
    Do you know if there is a way for me to reset my mailbox, to fully remove the UM capabilities and then start over?

  • Removal and adding tabs in user interface

    Hi,can anybody provide me solution for customizing the user interface page menu tabs in SUN Identity Manager.
    My requirement is,i need to remove and add main menu and sub menus in the user interface page in SUN Identity Manager.
    Thanks in advance.
    Edited by: SUNIDMDEV on Feb 21, 2008 10:52 PM

    Hello,
    Article Master and Material Master are one and the same in context (materials are referred as Articles in SAP IS Retail). Please refer the below link for creating the custom fields/adding tab pages
    adding custom tab in material master transaction
    Hope this helps
    Regards
    Shiva

  • How to remove and add the component to JFrame at runtime.

    Hi
    How to delete the JTabbedPane component from the Jframe at runtime and how to add the same component with different data at runtime.
    But the remaining components should not distrub.
    When i try to delete and add the component at runtime the remaing components are distrubed.
    when i minimize and maximize the screen, the components are adjusted. but i need a help on this without minimize and maximize the screen.

    Hi
    I am sending my code snippet, please look into this......i am doing the same even though i am not able to..................can u suggest anything seeing this code snippet.
    here one function called createtabpane (It creates the JTabbedpanes with the table information at runtime).
    private void getTimeSheetObj(String weekDate){
    //Object[][] rowObj=null;
    try {
    System.out.println("Inside the gettimesheet method try block");
    if(projTables!=null){
    for(int i=projTables.length-1; i>=0; i--){
    JTable jt = projTables;
    jTabbedPane_Main.remove(jt);
    System.out.println("Removing Table:"+i);
    jPanel_Tabbedpane.remove(jTabbedPane_Main);
    jTabbedPane_Main = new JTabbedPane();
    jTabbedPane_Main.revalidate();
    jPanel_Tabbedpane.revalidate();
    getContentPane().validate();
    getContentPane().repaint();
    jTabbedPane_Main.addChangeListener(new ChangeListener(){
    public void stateChanged(ChangeEvent ce){
    getTabbedPaneListenerValues();
    // this.setState(JFrame.ICONIFIED);
    // this.setExtendedState(JFrame.MAXIMIZED_BOTH);
    res = GetTimesheetResponseDocument.Factory.parse(new File("C:\\Narayana.xml"));
    response = res.getGetTimesheetResponse();
    proDets=response.getProjectDetailsArray();
    numOfPro = proDets.length;
    String taskDayValues[] = new String[8];
    System.out.println(numOfPro);
    proArr=new Object[numOfPro];
    Object[][] taskValues=null;
    for(int p = 0;p<numOfPro;p++){
    System.out.println("Inside1");
    taskDet = proDets[p].getTaskDetailsArray();
    taskValues = new Object[taskDet.length][8];
    for(int t=0;t<taskDet.length;t++){
    System.out.println("Inside2");
    taskValues[t][0] = (taskDet[t].getTaskName());
    taskValues[t][1] = (taskDet[t].getDay1HH()+":"+taskDet[t].getDay1MM()).toString();
    taskValues[t][2] = (taskDet[t].getDay2HH()+":"+taskDet[t].getDay2MM()).toString();
    taskValues[t][3] = (taskDet[t].getDay3HH()+":"+taskDet[t].getDay3MM()).toString();
    taskValues[t][4] = (taskDet[t].getDay4HH()+":"+taskDet[t].getDay4MM()).toString();
    taskValues[t][5] = (taskDet[t].getDay5HH()+":"+taskDet[t].getDay5MM()).toString();
    taskValues[t][6] = (taskDet[t].getDay6HH()+":"+taskDet[t].getDay6MM()).toString();
    taskValues[t][7] = (taskDet[t].getDay7HH()+":"+taskDet[t].getDay7MM()).toString();
    System.out.println("After taskvalues");
    proArr[p]=taskValues;
    createTabPanes(jTabbedPane_Main, proArr);
    System.out.println("outside");
    jPanel_Tabbedpane.add(jTabbedPane_Main);
    jTabbedPane_Main.getAccessibleContext().setAccessibleName("Proj");
    getContentPane().add(jPanel_Tabbedpane);
    pack();
    }catch(XmlException xe) {
    System.out.println("Inside the XmlException block");
    System.out.println(""+xe.getMessage());
    } catch(IOException ioe) {
    System.out.println("Inside the IOException block");
    System.out.println(""+ioe.getMessage());
    /* JOptionPane.showMessageDialog(null,
    "Values Displayed in the below tables",
    "Alert!",JOptionPane.ERROR_MESSAGE); */
    System.out.println("Initial JFrame Bounds:"+this.getBounds());

  • To remove (and add) a panel inside a dialog.

    hello
    I would like to change the layout of one dialog.
    I thought to do it by removing one panel an adding another.
    That is the code I wrote:
    import java.awt.Component;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    public class TestForChangePanel extends JFrame {
        PanelOne panelOne;
        PanelTwo panelTwo;
        public TestForChangePanel() { // costruttore
            panelOne = new PanelOne(this);
            panelTwo = new PanelTwo(this);
            changeThePanel(panelTwo);
            setSize(200, 150);
            this.setDefaultCloseOperation(EXIT_ON_CLOSE);
            setVisible(true);
        } // costruttore
        static public void main(String[] args) {
            TestForChangePanel testForChangePanel = new TestForChangePanel();
        public void changeThePanel(Component panel) {
            System.out.println("function to changethe Panel");
            if (panel instanceof PanelTwo) {
                remove(panelTwo);
                add(panelOne);
                System.out.println("put Panel One");
            if (panel instanceof PanelOne) {
                remove(panelOne);
                add(panelTwo);
                System.out.println("put Panel Two");
             validate();
        } // changeThePanel()
    }// class TestForChangePanel
    class PanelOne extends JPanel {
        JLabel labelOne = new JLabel("LABEL ONE");
        JButton jbOne = new JButton("Change");
        TestForChangePanel owner;
        PanelOne xxx = this;
        public PanelOne(TestForChangePanel ownr) {  // costruttore
            owner = ownr;
            this.add(labelOne);
            this.add(jbOne);
            jbOne.addMouseListener(new MouseAdapter() {
                @Override
                public void mouseClicked(MouseEvent e) {
                    JOptionPane.showMessageDialog(null, "mouse panel ONE");
                    owner.changeThePanel( xxx);
        } // costruttore
    }  // class PanelOne
    class PanelTwo extends JPanel {
        JLabel labelTwo = new JLabel("LABEL TWO");
        JButton jbTwo = new JButton("Change");
        TestForChangePanel owner;
         PanelTwo xxx = this;
        public PanelTwo(TestForChangePanel ownr) { // costruttore
            owner = ownr;
            add(labelTwo);
            this.add(jbTwo);
            jbTwo.addMouseListener(new MouseAdapter() {
                @Override
                public void mouseClicked(MouseEvent e) {
                    JOptionPane.showMessageDialog(null, "mouse panel TWO");
                    owner.changeThePanel(xxx);
        } // costruttore
    }  // class PanelTwoThere is not error in the execution of the code. But the layouth of the dialog does not change.
    Please, someone can tell me why the code doesn't work how I think it should have to do ?
    thank you
    regards
    tonyMrsangelo.

    I never had any problem with revalidate.I still don't understand the difference between validate() and revalidate(). The vast majority of time they are interchangeable and a repaint() is not required. However, I have noticed a few cases where validate() works and revalidate() doesn't (and vice-versa). I have also noticed a few cases where repaint() is required. Of course I can't remember all the situations, but here are a couple of examples showing problems:
    This posting shows a repaint() is required when removing a single component:
    [http://forums.sun.com/thread.jspa?forumID=31&threadID=789317&start=8]
    And this posting shows a repaint() is required when removing and adding a component (but only if the last component in the container is removed and added)
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class ValidateTest extends JFrame implements ActionListener
         JComponent north;
         int number;
         public ValidateTest()
              north = new JPanel();
              getContentPane().add( north, BorderLayout.NORTH );
              north.add( new JButton("Button1") );
              north.add( new JButton("Button2") );
              north.add( new JButton("Button3") );
              north.add( new JButton("Button4") );
              JPanel south = new JPanel();
              getContentPane().add( south, BorderLayout.SOUTH );
              JButton validate = new JButton("Validate");
              validate.addActionListener( this );
              JButton revalidate = new JButton("Revalidate");
              revalidate.addActionListener( this );
              JButton repaint = new JButton("Repaint");
              repaint.addActionListener( this );
              south.add( validate );
              south.add( revalidate );
              south.add( repaint );
         public void actionPerformed(ActionEvent e)
              //  repaint() is needed in this case
              int position = 3;
              //  repaint is not needed in this case
    //          int position = 0;
              north.add( new JButton( "" + number++), position );
              String command = e.getActionCommand();
              if ("Validate".equals(command))
                   north.validate();
              else if ("Revalidate".equals(command))
                   north.revalidate();
              else
                   north.repaint();
         public static void main(String[] args)
              JFrame frame = new ValidateTest();
              frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
              frame.setSize(500, 200);
              frame.setLocationRelativeTo( null );
              frame.setVisible(true);
    You can even see in the JScrollPane tutorial they use revalidate without repaint when resizing the client area. I think, the key here is the "resizing" seems to automatically cause the area to be repainted.

  • Upgraded to Leopard get error need quicktime 7.5 or higher, have removed and uploaded both

    I just upgraded to Leopard and when I try to open up my ITunes I get an error message stating that I need to have quicktime 7.5 or higher, Leopard came with quicktime 7.5, but itunes is not recognizing it.  I have removed and added quicktime a few times and still get the same error message.  It is not allowing itunes to even open up.  Any suggestions to resolve this?  Thanks!

    Download and install QuickTime 7.6.4 for Leopard. Also be sure you have a compatible iTunes installed. Here is the current version: iTunes 10.5.2.

  • Powershell Script to Remove and Add the user with same permission

    Hi,
    I need to remove all users within all site collection of a web application and add them back with same permission level. We have a siteminder based custom trusted identity token issuer configured in our farm. The name of the issuer will be changed
    due to some architectural decissions , hence all users which are there before will be unidentified, hence need to be removed and added again.
    Currently each user looks like :                       c:0ǹ.t|Identity Token Issuer1|user1
    Post the change the user will look like:          c:0ǹ.t|Identity Token Issuer New|user1
    I am looking for a powershell script which can handle this operation.
    Thanks, Bivsworld

    Bivsworld,
    Below link should give you a start.
    http://www.sptechlearn.com/2014/10/delete-users-from-user-information-list.html

  • Yosemite. iPhoto has stopped sharing pix via email. Have tried removing and re-adding accounts. This is a new problem. What gives??

    I recently had a new hard drive installed and upgraded to Yosemite 10.10.1 on a Macbook Pro. No problems for the first week, then iPhoto 9.6 stopped sharing pix via email. I tried removing and re-adding my accounts but that didn't help. Thanks in advance for any advice. Ra Buck.

    PS. IPhoto doesn't seem to connect, but I'm not getting an error message.

  • Removing Server 2000 DC and adding Server 2008 DC.

    Removing Server 2000 DC and adding Server 2008 DC.
    From: Server 2000 Sp4 (not leaving in place, no plans to demote)
    To: Server 2008 Sp2 (will be a single DC and hold Global Catalog)
    Single forest domain. Only one DC.
    Problem: The old server 2000 is still a primary DC and the new server 2008 is not taking over.
    Completed the following tasks:
    NIC binding (connected NIC at top of list on new server)
    New server is also DNS server. This role is working and it points to itself 127.0.0.1 and clients have been moved to use the new server for DNS, they are working.
    New server has some shared folders. Clients are connected and this is working until we remove the old server, then they cannot authenticate to the mapped drive.
    Both servers show the role of Domain Controller
    Adprep /forestprep and /domainprep and /domainprep /gpprep were run on the server 2000 (as it was the existing DC) with a successful message.  (not sure if enough time was allowed for replication)
    All five Flexible Single Master Operations (FSMO) roles were transferred using GUI.
    Schema Master, Domain naming master, Infrastructure master, RID master, PDC Emulator.
    And have been verified. All roles transferred and the new server 2008 and new server is also the global catalog.
    Then to verify new server is handling the role we unplugged the Ethernet cable from the Old server 2000, then went to client stations and re-started them and they would not find the new DC and connect to it.
    On the new server when we opened active directory users and computers the domain did not appear.
    Verified in DNS manager the A record and reverse pointer were correct.
    For some reason the new server is looking to the old server. Even though all roles are moved over and DNS appears to be setup correctly it won’t exist independently.
    What’s missing?
    If something was missed or performed wrong, do we have to remove the roles and start from scratch? Or can we re-run adprep and walk the steps again leaving all as-is?

    Hello,
    as first step please post an unedited ipconfig /all from the old and new DC/DNS server and one problem client.
    It seems that your installation from the new DC wen't well and as described in
    http://msmvps.com/blogs/mweber/archive/2010/02/06/upgrading-an-active-directory-domain-from-windows-server-2000-to-windows-server-2008-or-windows-server-2008-r2.aspx Just check again yourself.
    A DC should NEVER be shutdown or just disconnected from a domain, it MUST be demoted correct, as you ruin into replication errors in the event viewer without that steps and you will never be able to install a additional DC with using the same name.
    See the end of my article about removal steps.
    Best regards
    Meinolf Weber
    MVP, MCP, MCTS
    Microsoft MVP - Directory Services
    My Blog: http://msmvps.com/blogs/mweber/
    Disclaimer: This posting is provided AS IS with no warranties or guarantees and confers no rights.

  • Lifeline Service removed and Unlimited Local Calling added, what gives?

    I received quite a shock when I received my bill recently. Apparently, my Lifeline Service was removed and Unlimited Local Calling was added instead, tacking on an additional $12 to my landline bill. What gives? I do plan to call Verizon to investigate the matter on Monday, but I am wondering why this is. Is it because Lifeline Service requires that I renew after a number of years, or what? 

    I'm afraid that's the kind of answer you can only get from Verizon.  It looks like your issue may require a Verizon representative to review your account details. Please contact our customer service team via live chat or email at:
    http://www.verizon.com/contactus
    Choose “Live Chat.”
    If a chat agent is available to assist you, the chat link will become live after the page is fully loaded.

  • Made a new iTunes address, and added new payment details, old apps won't update because my old signin pops up! Even tho in settings on on first page it's my new name? How can I remove the old signin name even if it takes all apps paid and free with it!!

    Made a new iTunes address, and added new payment details, old apps won't update because my old signin pops up! Even tho in settings on on first page it's my new name? How can I remove the old signin name even if it takes all apps paid and free with it!! Don't care if I have to lose all previous apps just don't want to be hassled with updates!

    You can't all apps are tied to the apple id that was used to purchase/download it.

  • HT1277 I can't seem to get gmail from my apple mail account. I have removed the account and added it, but it says I have the wrong password. I close gmail and get in just fine. What's up?

    I can't seem to get gmail from my apple mail account. I have removed the account and added it, but it says I have the wrong password. I close gmail and get in just fine. What's up?

    I meant that I sign out, sign back in ok. Ergo, I know my password. Someone here on the support page  (you?) told me the culprit is the 2 step verification process which I had on. That makes a lot of sense as Apple mail won't get a code thereby jamming up the process. I could not even start a new account until I took that 2 step process off. Everything fine now thank you.

  • [svn:osmf:] 9866: Adding '@throws' clauses to ILayoutRenderer add/ remove target methods, and adding a 'targets(target:ILayoutTarget)' method that allows checking addition/removal validity up front.

    Revision: 9866
    Author:   [email protected]
    Date:     2009-09-01 00:56:48 -0700 (Tue, 01 Sep 2009)
    Log Message:
    Adding '@throws' clauses to ILayoutRenderer add/remove target methods, and adding a 'targets(target:ILayoutTarget)' method that allows checking addition/removal validity up front.
    Modified Paths:
        osmf/trunk/framework/MediaFramework/org/openvideoplayer/layout/ILayoutRenderer.as
        osmf/trunk/framework/MediaFramework/org/openvideoplayer/layout/LayoutRendererBase.as

  • Can an InCopy editor add, remove and edit a text frame placed inside the main story text frame?

    I think I already know the answer to this which is - no. I'll explain why I am asking the question in a second, but the reason I think the simple answer is no is because - text frames are controlled by a designer in the layout file, an editor using incopy can only edit the text and images placed inside text frames, and so cannot resize them, add or delete them.
    Ok, so the reason I have asked this.
    Is there a way around this so that editors in incopy can edit certain types of text frame that are contained within the main text frame? I'm using these text frames to contain specific paragraph styles, giving them a boxed look and also with an anchored icon in the top left of the text frame depending on the type of paragraph it is. See screenshot as an example of a green text frame that I am using to contain paragraphs of type "tip".
    If it is not possible for editors in incopy to add, edit or resize these text frames (green tip frame in the example above), then how else can I style these paragraphs to give the same visual appearance, but without the use of wrapping them in a text frame?
    One (not so good) way around this is for the designer to add the text frames in the layout file after he gets the content back from the editor, then moving the "tip" paragraphs into these newly created text frames. However when the editor updates the content in incopy and gets these new text frames in their copy, they can not then delete them if they wish to, or if they add or reduce content inside of these green text frames then the frames dont grow to fit their edited content. So I dont think its a solution for the designer to control the adding, removing and resizing of these frames.
    UPDATE: I have just discovered that once a text frame has been placed into the document by the designer and the editor updates their copy in incopy-  they can then use the "Position Tool" to select that text frame - allowing them to resize it, or delete it! Fantastic. But would the editor be able to add these frames in themselves to begin with? Maybe have a document containing all of the objects available to them, copy and paste one of them into the main document and edit its content? Does anyone have any advice on how to go about this? Essentially I would like the editor to control the insertion, editing and removal of these inline text frames.

    True. But when all I am trying to achieve is a border around a paragraph, use of a table seems overkill to me. But if thats the only solution I have so far then I will have to go down that route.
    It would be useful to have an object libraries panel in InCopy so that editors can drag across predefined text frames into their doc via InCopy, but I cant see that option in InCopy. is there one? I have also thought about exporting the frames as seperate InDesign Snippets and saving them to an objects folder, then when an editor needs to insert one into their doc they simply use File > Place > "Choose required text frame snippet". However I have found that InCopy can't place InDesign snippets so that theory was a failure. Is there another format I could use to save the objects and bring them into InCopy? List below shows my findings so far for trying to save/export a text frame from InDesign and then import into InCopy:
    InDesign Snippet (.idms) - can't import into InCopy
    InDesign Document (.indd) - imports content as an image - only editable in InDesign
    InDesign Template (.indt) - imports content as an image - only editable in InDesign
    InDesign Library (.indl) - can't import into InCopy - no panel available in InCopy for object libraries (that I can see...)
    InCopy Markup (.icml) - only imports the text, loses the text frame

Maybe you are looking for

  • Sending a JPanel to the printer...

    All, I wasn't sure if this was the appropriate forum for this, but I couldn't find one specific to printint to a printer. I'm trying to send a JPanel to a printer. I have the following routine which seems to more or less work, but exhibits a few prob

  • Yosemite 10.3.3 2nd monitor resolution problem

    I just updated to the new Yosemite 10.3.3 on my Mac Pro 2011 and my second monitor will not let me choose my correct display resolution. It only lets me choose 1080i, 1080p, 720p. It worked fine at 1920x1080 before the update and filled the screen co

  • Problem with unix "foreach" command

    Hi, I am facing a problem with unix command "foreach". I trying to process files using unix foreach command. When running the script with 500 or 1000 files. It is running fine. But when I am trying to the script with 2000+ files. Its throwing an erro

  • How to install garageband? oldish computer

    how do i install garageband on my ibook? i downloaded it and it just comes up with a message that says "an eligible GarageBand application was not found in /Applications". oh and my operating system is mac os x 10.4.11. sorry if this is a stupid ques

  • Translating Screen status items in ABAP

    Hi Experts, However i am able to translate other screen texts till now using SE63 -> Then entering SCRT in command field -> Giving Program name with screen number and source lang. and target lang. in upcoming screen and executing and saving after tra