Jscrollpane not updating dating want ads

To that end I am trying to share several complete Java source code examples that demonstrate how to work with components like these.

Here is the source code for a complete Java class that demonstrates how to use a import

I'm thinking that you're almost trying in a round about way to create your own version of JTable.

Why not simply use a JTable directly to display your data?

For the love of all things good, *never* set the layout of a JScroll Pane to null. JScroll Pane uses a special layout, Scroll Pane Layout, that allows it to handle its viewport properly, and by setting the layout to null, you've in effect nullified this, and have prevented your JScroll Pane from working.

In fact you should avoid using null layouts if at all possible for all of your Swing coding.

Now the problem i'm facing is when i run the prog i can see the contents of the panel(not all) and i can also see scrollbar but i can't find the knob to move it back and forth please look into my code and help me out.

Next of all, to see the JScroll Pane's scrollbars, you will need to add a component into its viewport View, and this component will need to be larger than the JScroll Pane itself.

Note that you don't add components directly to the JScroll Pane itself.

In the Java look and feel, this preferred size happens to be a bit less tall than required for the text area to display the 5 rows that we requested when creating it, so the scroll bar initially displays a vertical scroll bar.

If we didn't restrict the size of the scroll pane's container, the scroll pane would be big enough for the text area to display the full 5 rows and 30 columns specified with the The scroll pane in this application looks very different from the one in the previous demo program.

Leave a Reply