i've an applet and i'm adding AWT ScrollPane to it. now, i'm adding individual panels (as records) into a new AWT Panel(which is null layout) and placing this AWT Panel in AWT ScrollPane.
the individual panels getting added vertically but when i resize the applet, all the individual panels(as records) laid out horizontally and so, obviously, only the horizontal bar is alone visible. instead i need it in vertical order only.
how to overcome this issue?
posted 13 years ago
have you tried making the root panel BoxLayout on Y_AXIS?
Here's an example (lists all the fonts on your system):
NOTE: code runs faster if you embed Label rather than Panel in the main panel... if you are worried about performance eg // pnlMain.add(new Label(fontNames[i]));