swing

Java Jframe, needs to switch windows first before controls can be used

Sorry for the messed up title 'cause I don't really know what title I should use xD Anyways here's the problem. So I got this simple game that starts with a Jframe that contains a single button which is if pressed, changes the contents of it to the content of another class that contains the game...

FlowLayout in Swing doesn't move to the next line

I'm using a flow layout inside a scroll panel. I keep adding button expecting them to add to the next line when there is no more available space, but they just keep adding. I want the scroll bar to only scroll vertically, not horizontally. My code: JPanel panel = new JPanel(new FlowLayout(FlowLayout...