Transition [cant remove old JPanel]

Hello!
I want to make transition between two JPanels(actually objects based ont them..)
I can hide splashpanel from Frame.java, but cant from SplashPanel.java
I know i am doing somethin really wrong, but dont know what.
So here is the code.
Frame.java
package ui;
import javax.swing.*;
import net.miginfocom.swing.MigLayout;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.util.Deque;
import java.util.Stack;
@SuppressWarnings("serial")
public class Frame extends JFrame {
     public Frame() {
          // Set default size and position of screen
          Toolkit toolkit = Toolkit.getDefaultToolkit();
          Dimension scrSize = toolkit.getScreenSize();
          int scrX = scrSize.width;
          int scrY = scrSize.height;
          int X = (scrX - 750) / 2;
          int Y = (scrY - 550) / 2;
          setSize(750, 550);
          setLocation(X, Y);
          setTitle("Blood of a shadow");
          Image bloodlogo = toolkit
                    .getImage("E:\\Java\\Blood of a Shadow\\src\\ui\\bloodlogo.gif");
          setIconImage(bloodlogo);
          showsplashpanel();
          //clearAll();
     public void showsplashpanel() {
          SplashPanel splashpanel = new SplashPanel();
          add(splashpanel);
     public void clearAll() {
          System.out.println("It came to clearAll method of Frame class");
          removeAll();
          validate();
          repaint();
          System.out.println("an to the end...  damn");
}SplashPanel.java
package ui;
import java.awt.Color;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import javax.swing.JPanel;
import net.miginfocom.swing.MigLayout;
@SuppressWarnings("serial")
public class SplashPanel extends JPanel{
     public SplashPanel() {
          setFocusable(true);
          KeyListener keylistener = new KeyListener() {
               public void keyPressed(KeyEvent e) {
                    char key=e.getKeyChar();
                    int keycode=e.getKeyCode();
                    if(keycode==65) {
                         new Frame().clearAll();
                    System.out.println(key+" | code: "+keycode);
                public void keyReleased(KeyEvent e) {
                public void keyTyped(KeyEvent e) {
          addKeyListener(keylistener);
          MigLayout layout = new MigLayout("gap 20px 15px");
          setLayout(layout);
          setBackground(Color.BLACK);
          ShadowLabel newgame = new ShadowLabel("New Game");
          ShadowLabel loadgame = new ShadowLabel("Load Game");
          ShadowLabel help = new ShadowLabel("Help");
          ShadowLabel author = new ShadowLabel("About author");
          add(newgame, "wrap");
          add(loadgame,"wrap");
          add(help,"wrap");
          add(author,"wrap");
}keycode 65 = a or A
Thanks in advance!
GrizzLy

Nevermind, i solved it!

Similar Messages

  • Trying to install quicktime/itunes....cant remove old qt mssg!!

    Like the title says, im downloading itunes or even the quicktime update, just as its about to be finished a mssg pops up saying the older version of quicktime cant be removed. Ive tried to remove it through the control panel and in the drop down menu for quicktime itself. Any help would be greatly appreciated!

    follow support article 2738 remove all old install files with VB script tool. However, after seperate installs of Safari, I tunes or Quicktime, run VB script tool 5.6 . Error 2738 does not show up on my PC it simply says location is only a network resourse.

  • Cant remove old IDE drive from G4 Mac!!!

    Guys, if any of you MAC experts can help me out with this, I'd appreciate it.
    I'm having a really wierd problem:
    I completely rebuilt an AGP Graphics G4 Mac.
    I installed a Tempo SATA card, a SATA drive and an external firewire drive (also SATA, but connected via the firewire port).
    So......once I had all the drives up and running, I used "SuperDuper" to clone the original, 30 gig IDE drive (the boot drive) to the External Firewire drive. No problem.
    In "System Preferences", I set the G4 to boot up from the External Firewire drive. Shut down and restarted.
    The G4 seemed to boot fine off the External Firewire drive. To check, I pulled up "about this Mac" and it said "startup drive...external" Also, the external drive now appears in the upper right hand corner of the screen.
    BUT!! When I opened the case and removed the old IDE drive, and restarted, the G4 will not boot!!!
    It seems to need the old IDE drive connected even tho its booting off the External Firewire drive!!!
    Does anyone have ANY idea whats going on here? I really need to remove the IDE drive because its old and its gonna crap out at some point. I have to be able to boot with it out of the machine.
    Do you think its still ooting off the old IDE drive even tho the system is telling me its booting off the external drive?
    help!
    thanks,
    Retro

    There may be a need to use a keyboard command for the computer to boot off an external
    FireWire enclosed hard disk drive when there is an unsuitable or no internal IDE PATA drive
    in the computer's case; one that forces the computer to search for a suitable boot volume
    on startup. This issue may force you into further troubleshooting the computer hardware.
    Perhaps the clone used in the external has some permissions issues and relies on the
    presence of the original drive for validation? Some clones need to have those kinds of
    permissions turned off or set to be off when the clone is made.
    With a new replacement hard disk drive in the original internal drive location, a clone of
    the external could be made into that new drive; and be sure the conditions of the clone
    process are correct before you wipe any original disk content, so you can go back for
    another clone should some error in the process require you to reference the first, again.
    There is an ATA controller card in computers which may have something to do with how
    multi-disk drive computers see and use additional internal items on the same bus, but
    this should not affect the FireWire external's bootability, if it was natively capable of it.
    On the face of it, this sounds like an odd issue. Replacing the aging old drive with one
    capable of running the computer, from its original location, is probably a first step.
    In any event...
    Good luck & happy computing!

  • Can't remove old icloud account

    cant remove old icloud account

    I'm not sure what you mean. If the phone was previously owned by someone else and it is their iCloud account it is impossible for you to remove it. You must contact the previous owner and have them remove the phone from their account.

  • HT5621 I Have followed all the steps and still cant remove iCloud to my existing account and add to the new one, the old email account was changed a year ago and cant get that email plus the password don't work please HELP!!

    I Have followed all the steps and still cant remove iCloud to my existing account and add to the new one, the old email account was changed a year ago and cant get that email plus the password don't work please HELP!

    Welcome to the Apple community.
    This feature has been introduced to make stolen phones useless to those that have stolen them.
    However it can also arise when the user has changed their Apple ID details with Apple and not made the same changes to their iCloud account/Find My Phone on their device before upgrading to iOS 7, or if you restore from a previous back up made before you changed your details.
    The only solution is to change your Apple ID back to its previous state with Apple at My Apple ID using your current password, you don’t need access to this address if it’s previously been used with your Apple ID, once you have saved these details enter the password as requested on your device and then turn off "find my phone".
    You should then change your Apple ID back to its current state, verify it once again, delete the iCloud account from your device and then log back in using your current Apple ID. Finally, turn "find my phone" back on once again.
    This article provides more information about Activation Lock.

  • I cant remove my old work information on face book. please give me solution

    i cant remove my old work information on face book. please give me solution because i want to change it i already try to edit profile option but no response

    Let Apple have a look at it.
    There's no one from Apple here; we are all fellow iPad user.

  • My ipad has a message saying a movie rental has expired and i cant remove it so am unable to use my ipad. can anyone help?

    Hi
    My ipad has a message saying a movie rental has expired and I cant remove it, so am unable to use it. Can anyone help?

    Hi there, this problem has probably been resolved now, but I must say that I came across these posts today as I had the same problem, my old e mail kept popping up, but all sorted now!  Old Apps are not tied to the old Apple ID, honestly!
    Rudegar is so right, all you do is go the SETTINGS/iTunes & App Store, then select `Apple ID` `Sign Out` then you get the chance to enter your new ID, and it worked a treat!
    Good luck with anyone else with this problem, as I spent so long on this, really stupid!
    PS you`ll need to again verify bank details

  • Cant install new i tunes, cant uninstall old i tunes

    after upgrading to itunes 9.1 in the usual manner it froze and slowed computer down.
    Decided to uninstall and re-install afresh but wont let me uninstall old itunes and i get an message saying 'the feature you are trying to use is on a network resource that is unavailable?'
    so no itunes as if i try to install it i get messages saying it can't remove old components(bonjour etc) and then says it cant install quicktime.finish!

    I have tried installing quicktime on it's own but it tells me that at cannot remove the old version of quicktime and to contact technical support. It does this when i try to install itunes and seems to be unable to uninstall older versions.
    I have tried removing the itunes files in program files.
    If you try to uninstall it tells me it cant find itunes msi and to try to find the installation package itunes msi in a folder in which you can install the product i tunes.

  • Error in removing old version

    I cant remove the old version from iTune from my PC
    Any help please

    Hi Raja,
    The standard system supplies the following target cost versions:
    Target cost version 0 ( total variance)
    The amount of the total variance generates a posting in Financial Accounting during settlement.
    For this version, select actual costs as the control costs and standard cost estimate as the target costs.
    Target cost version 1 ( production variance)
    For this version you choose actual costs as the control costs and planned costs as the target costs.
    Target cost version 2( planning variance)
    With target cost version 2, the costs from the preliminary order cost estimate are interpreted as control costs. For this version, select planned costs as the control costs and current cost estimate as the target costs. You cannot calculate planning variances for the product cost collector.
    Target cost version 3 (production variance of the period)
    You compare the planned costs of the period calculated on the basis of an alternative material cost estimate (such as a modified standard cost estimate) with the actual costs of the period on the basis of the yield delivered to stock in the period.
    Try using "0" Version in combination with your Controlling Area.
    Pls revert back with result...
    Srikanth Munnaluri

  • How to remove old owner

    How to remove old owners name/apple Id out of my Iphone, because i cant upgrade ani Apps, because THE name/account of THE old owner is coming up olthe time, after THE upgrade to Io7
    I own à legal Iphone-4/16mb with à legal Apple Id.

    Only the old owner can remove their ID. This is Activation Lock, an antitheft protection system. Unless the previous owner releases the phone it cannot be used by anyone other than that owner. See: http://support.apple.com/kb/HT5661 for what the owner of an iPhone should do before selling or otherwise disposing of the phone.
    For more information on Activation Lock see: http://support.apple.com/kb/HT5818

  • What's difference between JPanel.remove(); and JPanel = null

    nice day,
    how can remove JPanel (including its JComponents), safe way, can you explain the difference between JPanel.remove () and JPanel = null,
    1/ because if JPanel does not contain any static JComponents
    2/ or any reference to static objects,
    then works as well as JPanel.remove or JPanel = null,
    or what and why preferred to avoid some action (to avoid to remove or to avoid to null)

    mKorbel wrote:
    nice day,
    how can remove JPanel (including its JComponents), safe way, can you explain the difference between JPanel.remove () and JPanel = null, Remove the JPanel from the container it was part of and make sure you do not keep any references to it from your own classes. Don't make it any more difficult than it has to be.

  • How to remove old iPhone from iTunes account?

    Last I was on itunes it told me I had 4 out of 5 authorized devices on my account, how do I remove old devices?

    Follow the instructions here >  iTunes Store: About authorization and deauthorization

  • HT203756 How can I remove 'old' or 'incomplete' backups from iCloud?

    How can I remove 'old' or 'incomplete' backups from iCloud? 
    When I attempted, the iPhone 6+ message asked if I wanted to remove ALL of the backups... without giving me the option of selecting the specific one I wanted to remove.
    I had performed 'backups' of my old iPhone, but, when I tried to RESTORE to the REPLACEMENT iPhone, at least one of the iCloud backups shows 'incomplete'.  There was no 'error' on the original iPhone...when it 'failed' to complete the backup.
    Now, I would like to 'clear up' the 'storage' on the iCloud, but am unable to select specific ones. I can either keep all instances or shut off iCloud Backup which would, according to the message, remove/delete ALL of the BACKUPS.
    This shouldn't be this difficult.....

    I too wondered how you remove apps from iCloud.  Judging by the quantity of questions, comments, suggestions and replies (some rather rude) there is a clear need for Apple to make their literature a lot clearer.  The page describing what iCloud backs up refers to "app data" as an item which is backed up.  To the uniniated this might mean the app program but it seems not.  The app is "bought" via iTunes or the App Store and details of your purchase (free or otherwise) is held there separately on the server.
    It would be nice however to be able to remove the reference to junk I have downloaded and decided I don't want so that it doesn't appear on the purchased apps listing!  Apple please note this.
    It must be remembered that Apple products come pitifully supported by manuals "out of the box" on the assumption that it is so easy to use the product that no explanation is needed.  They forget that most buyers of Apple products (me included) don't know (and don't want to know) how they work, so when something is not obvious they are required to plough through Lord knows how many web pages of "knowledge base" material until they find an answer.
    All I can add is that it is worth spending time reading the multiitude of discussion threads before asking the question yet again...

  • How do i remove old iphone backups on my itunes to free up disk space on my hard drive?

    im running low on diskspace and dont have much on my pc other than my itunes. i think the problem is all the iphone backups i have.. i have more than one iphone and have had all the generations. so i think tat my backups are using a lot of diskspace and only want to keep the most recent.so how do i remove old back ups from my itunes?

    If photo stream isn't working, put them in a folder and sync them to you phone by selecting the folder on the Photos tab of your iTunes sync settings and syncing.  Just be aware that if you want to delete them to your phone in the future you will need to sync them off your phone using iTunes as they can't be deleted directly on the phone.

  • Is there a way to remove old responses from the Acrobat Tracker?

    Is there a way to remove old responses from the Tracker if I have deleted the original sources? In other words, Acrobat.com and my desktop are out of sync.How I can get rid of any of these files.

    nvm. I found it.

Maybe you are looking for

  • I want  Apply  trigger to all the forms in application

    I have written a trigger when_timer_expired,it runs only when the form is runs. it does not execute when that form calls another form. Is there anyway by which the can apply the trigger to all the forms In the Application .

  • Delete current web site and set up a new one

    I have tried to delete the current web and wiki sites that were running, and now I don't have any default icons. When I go to my home page it says "Welcome to Mac OS X Server" on a white page and a list of LInks: Mail Send and receive email wherever

  • Officejet 7310 & F4580, scan fine, use MacBook Pro.Save as solid gray with banding.

    I used HP Deskjet F4580 and it scanned fine, the image looked fine. When I saved the image (pdf, jpeg, png) they all come out as a gray color with banding. I tried another printer/scanner, HP Officejet 7310 and the exact same problem.  I just purchas

  • Weblogic 12c + ohs 11.1.1.5

    Hello: I would like to know if it is possible to make an installation in AIX 6.1 of Weblogic 12c with Oracle Http Server 11.1.1.5. Is it certified? Thanks.

  • Best practice exam for 70-462?

    Hi All, I'll be taking the 70-462 Database Administration exam next month.  Any suggestions for practice exams?  There are a lot of available practice exams for sale.  I saw the Transcender practice exam for 70-461 and was not impressed, so this is d