jscrollbar

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

。_饼干妹妹 提交于 2019-12-01 17:56:08
问题 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 value attribute of the JScrollBar . Also i'm not sure to properly understand what the maximum represents and if i can use with the value to get the information i need. Edit : scrollPane.getVerticalScrollBar().addAdjustmentListener(new

Simple way of creating an animated JScrollPane in Java?

随声附和 提交于 2019-11-30 09:39:02
问题 I currently have a JScrollPane that holds what is basically a list of items. This JScrollPane is to be displayed on an information screen. What I'm looking for is some way of making it automatically scroll to the bottom of the list at a given interval, then back to the top. I recognise this is probably not achievable using a JScrollPane, so any suggestions for alternatives would also be great! 回答1: Normally I would use the TimingFramework or you could use something like Trident or the

Make a custom JScrollBar using an image

老子叫甜甜 提交于 2019-11-30 07:36:13
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 in an app and I really don't want to use either the default Java Scroll Bar or even the native OS Scroll Bar. I just want to be able to have a custom image be the Background of the scroll bar and an image to be the Thumb of the scroll bar. How to make a custom JScrollBar using an image? I wrote an example that shows how to set a custom image for the

Simple way of creating an animated JScrollPane in Java?

爷,独闯天下 提交于 2019-11-29 15:46:34
I currently have a JScrollPane that holds what is basically a list of items. This JScrollPane is to be displayed on an information screen. What I'm looking for is some way of making it automatically scroll to the bottom of the list at a given interval, then back to the top. I recognise this is probably not achievable using a JScrollPane, so any suggestions for alternatives would also be great! Normally I would use the TimingFramework or you could use something like Trident or the Unviversal Tween Engine as a bases for any animation. The main reason is, apart from doing most of the work for you

Make a custom JScrollBar using an image

青春壹個敷衍的年華 提交于 2019-11-29 10:23:27
问题 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 in an app and I really don't want to use either the default Java Scroll Bar or even the native OS Scroll Bar. I just want to be able to have a custom image be the Background of the scroll bar and an image to be the Thumb of the scroll bar. How to

Automatically scroll to the bottom of a text area

六眼飞鱼酱① 提交于 2019-11-29 02:47:33
问题 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 this? textAreaStatus = new WebTextArea(); scrollPane = new JScrollPane(textAreaStatus); textAreaStatus.setBackground(Color.black); textAreaStatus.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); 回答1: Have a look at the updatePolicy property of

Java JScrollBar Design

六月ゝ 毕业季﹏ 提交于 2019-11-27 15:54:18
I want customize the JScrollBar Design. I use Mac to develop the app with eclipse. I already tried to scrollPane.getVerticalScrollBar().setBackground(Color.BLACK); but nothing happen. My code: scrollPane = new JScrollPane(scriptView); scrollPane.setBorder(BorderFactory.createEmptyBorder()); scrollPane.getVerticalScrollBar().setUnitIncrement(6); window.getContentPane().add(scrollPane); The Object scriptView is from the class JEditorPane . How it should look: Thanks for every help. I guess you are looking for a transparent scrollbar. This is just presented as an idea(NOT tested code): import

Adding ScrollPane to JTextArea

ぃ、小莉子 提交于 2019-11-26 18:38:10
问题 I am working on a project for my college course. I was just wondering if anyone knew how to add a scrollBar to a JTextArea. At present I have the GUI laid out correctly, the only thing missing is the scroll bar. This is what the GUI looks like. As you can see on the second TextArea I would like to add the Scrollbar. This is my code where I create the pane. But nothing seems to happen... t2 is the JTextArea I want to add it to. scroll = new JScrollPane(t2); scroll.setBounds(10,60,780,500);

Java JScrollBar Design

你。 提交于 2019-11-26 17:24:43
问题 I want customize the JScrollBar Design. I use Mac to develop the app with eclipse. I already tried to scrollPane.getVerticalScrollBar().setBackground(Color.BLACK); but nothing happen. My code: scrollPane = new JScrollPane(scriptView); scrollPane.setBorder(BorderFactory.createEmptyBorder()); scrollPane.getVerticalScrollBar().setUnitIncrement(6); window.getContentPane().add(scrollPane); The Object scriptView is from the class JEditorPane . How it should look: Thanks for every help. 回答1: I guess

JTable with horizontal scrollbar

爱⌒轻易说出口 提交于 2019-11-26 16:32:20
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? First, add your JTable inside a JScrollPane and set the policy for the existence of scrollbars: new JScrollPane(myTable, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); Then, indicate that your JTable must not auto-resize the columns by setting the AUTO_RESIZE_OFF mode: myJTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); Nitesh