JTable and ScrollPanel issues

I am trying to make a GUI with a table that has a vertical scroll panel. Normally, this is easy, but I'm novice at java, and all I can say, is I used Studio Enterprise with absolute constraints to make the GUI how I liked it, then hacked the rest of the code in there, but I do not have a scroll pane upon resizing. Another interesting note - the column titles don't appear either. I've already browsed all simple table demos, does anyone have any ideas?

[464 byte] By [Stephen_Pa] at [2007-10-2 6:40:43]
# 1
Hi,read this: http://java.sun.com/docs/books/tutorial/uiswing/components/table.htmlThere is written how to put JTable in JScrollPane and about titles as well.Try examples and you will see that it is quite simple.L.P.
lukika at 2007-7-16 13:48:55 > top of Java-index,Desktop,Core GUI APIs...
# 2
It may be worth creating a simple demo and posting the code here to demonstrate the problems you're experiencing. At a guess, I'd say your layout was a bit of a mess but it's hard to say without seeing some code!
KPSeala at 2007-7-16 13:48:55 > top of Java-index,Desktop,Core GUI APIs...
# 3

If you are new to java it is a bad idea to use GUI editors. You need to code it yourself or you won't learn how Swing does things and you will have a very hard time fixing bugs. GUI editors might seem faster initially but in the long run it will take you longer.

Of course this is all just my personal opinion, but I don't think there are many people who would dispute this judgment.

if you code, manually, a simple example of what is happening you will probably find what the problem is. If you don't you have some good code to post on here and get help. (use the code tags).

ken

Ken_Sa at 2007-7-16 13:48:55 > top of Java-index,Desktop,Core GUI APIs...
# 4

Ken_S, I agree with you 100% !!! A programmer is supposed to program not to drag rectangles on the screen. This is not photoshop-***. So whoever wants to get a good programmer and/or to be able to debug programs - should write the code.

Actually code writing is an entire branch in the programming philosophy... :)

frosen_suna at 2007-7-16 13:48:55 > top of Java-index,Desktop,Core GUI APIs...
# 5
I agree too and for this reason I post the link to "How to use tables". These "How tos" are quite useful for beginers.L.P.
lukika at 2007-7-16 13:48:55 > top of Java-index,Desktop,Core GUI APIs...
# 6

I'm posting a follow-up to my problem. Although I cannot say exactly what was happening, I can tell you what I was doing, and what I changed.

Using Studio Enterprises visual developer, I was able to easily pick up some code, which was the initial proble - I didn't know any of the commands (I'm still a novice at Java programming). The first place I ran into trouble was the layout, which requires a little more thought. Things cascaded badly for me here - I used Absolute Layout to position my objects, which required importing an entire library (org.netbeans.lib.awtextra). Up to this point my problem was I could not create a table with column headers or a scroll pane. I was not able to resolve this problem under these circumstances.

Instead, now that I had a bit more experience with SWING, I figured out how to properly use the layouts. There are several tutorials that are excellent, but you're going to need a bit more patience - it's not as easy as learning how to make a table, per se. Once I properly utilized the layout, my problem seemingly vanished, as this time around, everything worked out as you would have thought. There's not much more to say, if I ever delve any further into this problem, and figure out exactl what was causing the problem, I'll follow this up, but to reiterate:

Use the simple tutorials to program your GUI from scratch, and, like so many others stated before, don't use a visual editor like I did.

Thanks

Stephen_Pa at 2007-7-16 13:48:55 > top of Java-index,Desktop,Core GUI APIs...
# 7
nice one! Thanks for the follow up.
Ken_Sa at 2007-7-16 13:48:55 > top of Java-index,Desktop,Core GUI APIs...