So i want to resize a panel thats embedded in a JScrollPane. But it works just one time. Here is my simple code.
public void setSizeKarte()
karte1 <- Panel embedded in ScrollPane
But I tried things like revalidate. Nothing works. Some hints?
Best How To :
Most Java Swing layout managers respect preferredSizes more than sizes. So a quick and easy solution could be to call
karte1.setPreferredSize(...), but this would risk other problems. Another solution is to override karte1's
getPreferredSize() method and allow method calls to affect its state and its return.
Note though that for better more thorough help, consider creating a minimal example program, one that is very short but that demonstrates your problem for us.