Hallo! Kann mir jemand erklären, wieso sich die Scrollleiste so komisch verhält? SIe wird nicht am Rand vom Frame angezeigt sondern es entsteht irgendwie so in einem grauen Kästchen. Ich erstelle zuerst das JScrollPane
Danach erstelle ich neue JPanels mit Textfields, Buttons etc in einem Layout, welche ich alle zum main JPanel adde. Am Ende adde ich noch alles zum Frame
Java:
this.controller = controller;
JPanel main = new JPanel();
JScrollPane jsp = new JScrollPane(main, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
Java:
this.add(jsp);