Questions tagged [jscrollbar]

JScrollBar is a Java Swing component to indicate the current position and the visible area size (by length of knob) if horizontal or vertical scrolling is involved so only part of the view is visible.

JScrollBar is a Java Swing component to indicate the current position and the visible area size (by the thumb length) if horizontal or vertical scrolling is involved so only part of the view is visible.

266 questions
4
votes
3 answers

How do I center the vertical and horizontal scrollbars in a JScrollPane?

I have a JPanel with a JLabel in it, added to a JScrollPane. I have an actionListener that calls JLabel.setIcon("file.jpg");. The image is displayed in the JScrollPane correctly and is full size. The scrollbars appear perfectly. I am trying to…
David Nelson
  • 43
  • 1
  • 5
4
votes
3 answers

Find standard JScrollBar width or height

I'm trying to place a component on the corner of the window. However, my window has a scrollbar and the scrollbar is placed on top of the component. So I'm trying to change the position of the component so that it is adjacent to the scrollbar…
ThePrince
  • 818
  • 2
  • 12
  • 26
4
votes
1 answer

Hide JScrollBar in a JScrollPane

Update : The second solution works perfectly but you have to be careful with the size of some of your object to not active default value for ScrollBar.You can't hide both you have to make a choice ;) I would like to hide the ScrollBar but still able…
g3r4n
  • 105
  • 1
  • 9
3
votes
3 answers

Java swing double buffering

i just started using double buffering and everything worked just fine until i wanted to add a JScrollPane to the screen so i later on can do some camera movements. Everything shows up fine (my sprites) EXCEPT the ScrollBars of the JScrollPane. And i…
Lucas Arrefelt
  • 3,879
  • 5
  • 41
  • 71
3
votes
1 answer

Force JScrollBar to scroll to line head

I am dealing with JEditorPane to display HTML documents and I created a button which scroll me to next view port every time I click it, "as if I am turning a page of a book". However, sometimes I see a part of a line at the top of the view port, so…
muaz
  • 550
  • 9
  • 15
3
votes
1 answer

Make JTable scrollable

I'm trying to create a JTable with 2 columns, one must show the name of the product, the second one, the price. The problem is that the JTable is very small, so i need a scroll, but i can't create it. DefaultTableModel model = new…
aerojun
  • 1,206
  • 3
  • 15
  • 28
3
votes
3 answers

Need help with logic of nested scrollpane

I need to make a "nested" scrollpane within another scrollpane and am looking for a bit of logic advice. Here is what I want to do - I'm going to use a 'digital cable television' analogy to make this easier since that's what it reminds me of. Think…
Lorne Schultz
  • 167
  • 1
  • 15
3
votes
2 answers

Smoother scrolling in a JScrollPane

Using a JScrollPane's scrollbar arrows to scroll (or by setting up key bindings for the arrow keys) moves the viewport one increment, pauses, then scrolls smoothly. Most scrollbars I've encountered behave the same; there's a slight movement, a…
bendicott
  • 369
  • 2
  • 17
3
votes
0 answers

Java Scrolling Bar disappears when using BorderLayout NORTH

Problem and Code Summary:This will make sense if you run the code below. I'm using a JScrollPane and its scroll bar is disappearing when it is placed in a JPanel with a BorderLayout (NORTH). When the JPanel has a BorderLayout (CENTER), it works fine…
akarshkumar0101
  • 367
  • 2
  • 10
3
votes
2 answers

JScrollBar don't show thumb in Nimbus L&F

I got a problem which only happens on Nimbus L&F. If there are too many items in a JList, the thumb of JScrollBar will disappear. But in metal L&F, the thumb will be always visible, because it has a min size. I have also checked the logic in Nimbus…
Alan
  • 33
  • 3
3
votes
3 answers

Can you make the background of a JScrollBar transparent?

I have a series of column labels that scrolls independently from the data that is displayed in a matrix below. I can make the whole scrollbar transparent except on hover. The labels are right up against the data, which I like, however, upon hover,…
hepcat72
  • 890
  • 4
  • 22
3
votes
3 answers

JPanel in JTabBar is not scrollable

enter code hereI am having the following problem. I am adding a two JPanels to one panel and add this finally to my TabbedPane. However, I want to make it scrollable, therefore I just make the Panel scrollable which just adds my scroller in the…
Carol.Kar
  • 4,581
  • 36
  • 131
  • 264
3
votes
1 answer

Java - Setting position of jScrollBar

I have a JTable in a JScrollPane, and the table gets new rows of data every once in a while. Eventually there are more rows of data than can be displayed at once and so the ScrollPane kicks in. I want the Scroll Pane to jump to the bottom (to its…
3
votes
2 answers

Adding a JScrollPane to a JMenu

I have a JMenu which will include JMenuItems that are generated on start-up from a database. As such, it's quite likely that the menu will be too large and run off the screen. As such, I am trying to add a JScrollPane to the JMenu. Example, to the…
Rudi Kershaw
  • 12,332
  • 7
  • 52
  • 77
3
votes
1 answer

Why JScrollBar doesn't respond to arrow keystrokes when coexist with editable component?

(Things will be clear in the code after description) I have a program that contains JScrollBar, JTextArea, JTextFields, JButtons and some other things. (I only added SSCCE codes) OK, I added key bindings for left and right JButtons of the JScrollBar…
Saleh Feek
  • 2,048
  • 8
  • 34
  • 56
1
2
3
17 18