I am working on a cool application. The frame has an alpha/transparency for the background as well as all of the panels on top of it.
When I need to change JPanels, I have it setup so one JPanel moves over to the left and the next one moves in, but in an animated way. When doing so the alpha messes up, its not as transparent anymore. If anyone could help that would be awesome but idk this one is tricky.
private class moveMainMenu implements Runnable {
public void run(){
try{
int x=h.getMainMenu().getY(),y=h.getMainMenu().getY();
for(int r=0;r<515;r++){
h.getMainMenu().setLocation(--x,y);
Thread.sleep(1);
}
h.getMainMenu().setVisible(false);
}catch(Exception e){}
}
}
What is set before alpha/opacity/transparent wise: (the panel being moved is a JPanel with no background, completely invisible so it must be messing up the frames background because that is what is still messed up even after the frame I am moving is gone)
h.getFPrimary().setBackground(new Color(51,255,102,50));