jscrollbar

recursive calls to AdjustmentListener - StackOverFlow Error Swing Java

左心房为你撑大大i 提交于 2019-12-18 09:29:07
问题 I have to synchronize the horizontal scrolling of tables. The columns would be the same only property that can be changed for the columns is their size. Now the following code shows 3 tables with synchronised scrolling. But as i change size of any one column in any of the table and then try to scroll, i get an Stack Overflow error and the gui is distorted. I am trying to achieve it by setting the viewport position of rest of the tables to the column which comes first on the left hand side. If

mouse wheel listener not working in jscrollbar

霸气de小男生 提交于 2019-12-13 14:08:07
问题 I am developing a desktop application in netbeans platform (netbeans module) in which i have a desktoppane and a jscrollbar. i have implemented MouseWheelListener and added scrollBar.addMouseWheelListener(this); in the constructor of the class. now when i am scrolling the wheel of mouse it do not scroll the scroll bar though i am getting values in the private void scrollBarMouseWheelMoved(java.awt.event.MouseWheelEvent evt) { System.out.println("mouse value is------------ " + evt.paramString(

Java - Setting position of jScrollBar

心不动则不痛 提交于 2019-12-13 01:25:55
问题 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 maximum value) every time new data is added, so I wrote this, which is called right after the new row is added: jScrollPane1.getVerticalScrollBar().setValue(jScrollPane1.getVerticalScrollBar().getMaximum()); It works quite well, but there is a

Custom JScrollBar-Thumb is painted, but doesn't move

最后都变了- 提交于 2019-12-12 18:24:41
问题 I decided to dive a little bit deeeper in the materia of swing and custom painting components. The last few days I read tons of articles, API-documentations and questions here on StackOverFlow and other forums. But still I got some basic problems in understanding the concept. What I want to do: Basically, I want to design some components for my own Swing GUI. I don't have much problems designing a custom JButton. I just create an custom Image in paint.net, create an ImageIcon and make JButton

Java swing double buffering

你。 提交于 2019-12-12 09:50:25
问题 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 want them to be shown! However if i resize the window, the scrollbars flicker, so i know they are there! I can even use them if i'm fast enough. How come they dont show up at rendering? :( Here is a SSCCE of the problem: public class

Java - Open JScrollPane with JScrollBar set to the right

╄→гoц情女王★ 提交于 2019-12-12 02:48:17
问题 I'm looking to try and load up a JScrollPane with the horizontal JScrollBar set all the way to the right, i.e. like in this image: http://i.imgur.com/VeKYPa6.png However, no matter what I do, I end up with this image: http://i.imgur.com/c9KzRqZ.png This is the relevant snippet of my code JComponent graph = new TrendsForSuccLarge(wccScores, wccScoresTimes, graphStrings, maxScore, bgColour, iPadWidth); JScrollPane graphScrollPane = new JScrollPane(graph, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED

Implementing JScrollPane/JTextArea in SwingWorker

﹥>﹥吖頭↗ 提交于 2019-12-12 01:05:22
问题 I am having some trouble with my JScrollPane/JTextArea when using a SwingWorker. Here is what I currently have: JTextArea txtDirs; Task task; //EDT public void createGUI(){ txtDirs = new JTextArea(); txtDirs.setBounds(10, 56, 414, 125); txtDirs.setEditable(false); contentPane.add(new JScrollPane(txtDirs)); task = new Task(); task.execute(); } class Task extends SwingWorker<Void, Void>{ @Override public void doInBackground(){ for(file : files){ txtDirs.append(file.getAbsolutePath); } }

Adjust shape dimensions using a JScrollBar

会有一股神秘感。 提交于 2019-12-11 21:34:51
问题 I want to be able to change the positions and/or sizes of a shape using a JScrollBar. I am still fairly new to swing components but have figured out how to change the position of a string, but I don't know how to go about it with a shape drawn from a paintComponent. I have this as my adjustment listener: scrollBar.addAdjustmentListener(new AdjustmentListener() { @Override public void adjustmentValueChanged(AdjustmentEvent e) { double value = scrollBar.getValue(); //returns current value of

Custom scrollbar arrows

守給你的承諾、 提交于 2019-12-11 09:11:31
问题 Im am trying to customize a jScrollPane using the code below. It works, It changes the color the way I want it, but hides the arrowbuttons. What I want is to make them visible again and change them with a custom image. I tried searching on this forum, but I couldnt find any info about it. I hope someone can help me. Thanks in advance! private Image imageThumb, imageTrack; private JButton b = new JButton() { @Override public Dimension getPreferredSize() { return new Dimension(0, 0); } };

Java Game - ClassCastException

Deadly 提交于 2019-12-11 08:22:57
问题 I am developing a simple java game and my scrollbar is raising an exception. The scrollbar is supposed to be a "gameslider". Exception in thread "Thread-3" java.lang.ClassCastException: sun.java2d.NullSurfaceData cannot be cast to sun.java2d.d3d.D3DSurfaceData at sun.java2d.d3d.D3DRenderer.copyArea(Unknown Source) at sun.java2d.d3d.D3DSurfaceData.copyArea(Unknown Source) at sun.java2d.SunGraphics2D.doCopyArea(Unknown Source) at sun.java2d.SunGraphics2D.copyArea(Unknown Source) at javax.swing