Java GUI Help - jScrollBar

Kasugi

Active Member
Joined
Mar 23, 2008
Messages
40
Reaction score
0
Location
I was just leaving, soz.
Hey, so I'm trying to make a jScrollBar work with a jForm and the coding I've seen thus far always incorporates a jPanel. Is there any way to make the jScrollbar work without a panel? I'm not using classes or anything - it's not a major project.
It's just working with frames and coding behind the frames, so when I go to the jScrollBar bit of the code it starts off :

private void jScrollBar1AdjustmentValueChanged(java.awt.event.AdjustmentEvent evt) {

}

Coding in NetBeans here :)
 
Hey, so I'm trying to make a jScrollBar work with a jForm and the coding I've seen thus far always incorporates a jPanel. Is there any way to make the jScrollbar work without a panel? I'm not using classes or anything - it's not a major project.
It's just working with frames and coding behind the frames, so when I go to the jScrollBar bit of the code it starts off :

private void jScrollBar1AdjustmentValueChanged(java.awt.event.AdjustmentEvent evt) {

}

Coding in NetBeans here :)

I'm sorry if this comes across as a flame, but...

Not using classes? Impossible.

Yes, you can do pretty much anything you want with the widgets, but I would really recommend that you use a JScrollPane.

You REALLY shouldn't be working with these components directly.
 
Well I have a DBConnection class to access a database I'm working with. I tried placing a jScrollPane atop a jFrame but I cant put lables and other components in - should I place a jPanel over the scroll pane? And will the scroll bars then automatically "kick in" without having to furthur insert coding for it?
All I essentially need to do is make the horizontal scroll bar function. I don't need the code to insert it, because I've done that with Netbeans but I don't really know how to make it work :\ it's not a high powered project, it's just something for school.
Any alternative suggestions?
 
Last edited:
Top
Sign up to the MyBroadband newsletter
X