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.

263 questions
43
votes
4 answers

JTable with horizontal scrollbar

Is there any way to enable horizontal scroll-bar whenever necessary? The situation was as such: I've a JTable, one of the cells, stored a long length of data. Hence, I need to have horizontal scroll-bar. Anyone has idea on this?
Mr CooL
  • 1,409
  • 7
  • 23
  • 26
13
votes
2 answers

Automatically scroll to the bottom of a text area

I have a text area with scroll bar. At regular intervals, I am adding new lines of text to it. I would like the text area to automatically scroll to the bottom-most entry (the newest one) whenever a new line is added. How can I accomplish…
itro
  • 6,260
  • 23
  • 69
  • 98
11
votes
2 answers

stop horizontal scrolling in JTextArea

I want to add a JTextArea to an application. Normally that textarea contains large content and both horizontal and vertical ScrollBars appear when running that application. I want to remove horizontal scrolling; I have found that it is possible with…
Mad
  • 121
  • 1
  • 1
  • 4
9
votes
2 answers

How can I detect if a JScrollPane's scroll bar changes visibility?

I have JScrollPane that contains some images in a horizontal row. If the row of images is too long for the view port, the JScrollPane shows a scroll bar, reducing the height of the view port. I'd like to resize the images to fit the view port. How…
xmjx
  • 1,128
  • 7
  • 17
5
votes
4 answers

NetBeans: how to add ScrollBar to JPanel

I am developing a small desktop application in NetBeans. On my UI, I place a JPanel and put a single JLabel on it. The content of this JLabel is generated dynamically, so if the content is very large then it goes out of screen.So is there any way in…
Jame
  • 18,248
  • 32
  • 76
  • 102
5
votes
1 answer

How to a add a vertical scroll bar to a JTextArea in Swing?

I have this Gui class: public class Gui extends JFrame implements ActionListener { /** * */ private static final long serialVersionUID = -384241835772507459L; JLabel playerInfo; JTextField textField; private final static String newline =…
Erik Balen
  • 275
  • 1
  • 4
  • 11
5
votes
4 answers

How to set jTextArea to have height that matches the size of a text it contains (to avoid scrollbars)

This problem looks trivial, but I can't find the solution. When I create a form it contains a JTextArea. I want to put large constant text in it. If the text is say 1000 lines long, I want my JTextArea to be 1000 lines high (to be large enough to…
celicni
  • 400
  • 3
  • 6
  • 16
5
votes
4 answers

How to know if a JScrollBar has reached the bottom of the JScrollPane?

I'd like to know if there is a way to know when a JScrollBar (vertical in my case) has reached the bottom of his containing JScrollPane. At first i have though of using an AdjustmentListener on the scroll bar but i don't know how to interpret the…
nathan
  • 1,031
  • 3
  • 16
  • 32
5
votes
2 answers

Make a custom JScrollBar using an image

So I use Java Swing to build the UI for my app and use custom images to replace the ugly Java ones, the custom images have a style and are very easy to integrate into Java Swing. Right now my problem is I need to use a JScrollBar with a JScrollPane…
Sammy Guergachi
  • 1,866
  • 4
  • 24
  • 48
4
votes
1 answer

Add scroll-lock button to JScrollBar

Background Looking to add a scroll-lock button to the corner of JScrollPane without obscuring the view port contents. The following image shows a JScrollPane wrapped in a SwingNode within a JavaFX application: The lower-right corner shows a button…
Dave Jarvis
  • 28,853
  • 37
  • 164
  • 291
4
votes
2 answers

JScrollBar Vertical/Horizontal setting problem- Java Swing

I am just trying to add a vertical scroll bar to my TextField and TextArea. I am using a ScrollPane and it should create avertical/horizontal scroll bar by default. Problem: I need a vertical scroll bar to see the data which is not visible. In the…
JJunior
  • 2,751
  • 15
  • 50
  • 66
4
votes
1 answer

How to open new window after JProgressBar is completed

I created FlashScreen.java as loading screen consist of JProgressBar. I want that after progressbar percentage is completed current window should be closed and new window should be open. I made it but after closing first window in next window there…
user6294821
4
votes
2 answers

Z-index doesn't work with overlapping a parent DIV with one inside it

What I am trying to do is to hide the scrollbar of a DIV. In order to do that, I created an outer DIV with overflow-y: hidden; and placed a slightly wider DIV inside it. I gave the outer DIV higher z-index than the inner one. Both have position:…
4
votes
1 answer

Swing scrollbar for scaled image

I have created a custom JSlider that is used to zoom in and out on an image. I want to add a scroll bar when the image becomes to large to fit into my 400x400 frame so that the user is able to pan across the image, there should not be a scroll bar…
Wheels99
  • 77
  • 7
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
1
2 3
17 18