jslider

Using Java Dictionary…use a Hashtable?

痴心易碎 提交于 2020-02-23 09:52:08
问题 I'm a bit surprised no one has asked about this specific case, cause it's kind of a weird inconsistency in the java standard libraries: I'm using swing JSliders with custom labels; the only library call available to assign labels is: setLabelTable(Dictionary labels) But Dictionary is an abstract class, and its only known subclass in the standard lib is Hashtable, which the api & various IDE's complain about because it's "obsolete." The obvious thing to do is just use the Hashtable, but I'm

Rendering a single point in a JFreeChart based on the current Value of a Slider

血红的双手。 提交于 2020-01-16 18:51:10
问题 I'm not yet as much into Java as I'd like to be, so I find my current task to be quite a bit challenging: A chart showing data gathered in another class. A slider whose end value is determined by the last entry of in the dataset used in the chart. The playbutton currently doesn't do anything except letting the slider tick in steps of 5 until it is paused again. My problem right now is: I am supposed to highlight one item at a time in the chart based on which value the slider currently shows.

Rendering a single point in a JFreeChart based on the current Value of a Slider

a 夏天 提交于 2020-01-16 18:50:53
问题 I'm not yet as much into Java as I'd like to be, so I find my current task to be quite a bit challenging: A chart showing data gathered in another class. A slider whose end value is determined by the last entry of in the dataset used in the chart. The playbutton currently doesn't do anything except letting the slider tick in steps of 5 until it is paused again. My problem right now is: I am supposed to highlight one item at a time in the chart based on which value the slider currently shows.

Change listener creates hinderance in JSlider

 ̄綄美尐妖づ 提交于 2020-01-16 17:34:58
问题 I have writen this code for playing music, the JSlider moves automatically forward with the progress of music, I have add change listener to JSlider for changing the music position with cursor, the problem is that when the nob of JSlider moves with the progress of music changeListener(); method is also invoked, this create hindrance in playing music, so therefore I want that the changeListener(); method should be invoked only when I move the nob of JSlider with cursor. Please tell how it can

Changing the min and max value of JSlider depanding on condition

為{幸葍}努か 提交于 2020-01-14 10:31:13
问题 I'm creating a Swing GUI in Netbeans. The purpose of this GUI is to open an (buffered)image (in a JLabel as icon) and apply Affine transforms on it. Now there are 4 transforms that I'm doing as follows. Now, each transform requires two sliders to change the X and Y value, except that of rotate, which will require only one. I did it this way since its much better than having to do four tabs for all 4 types of transforms. Also I want it to be such that , for example, if an image is rotated, the

Multiple JSliders activating and deactivating - Sharing values

可紊 提交于 2020-01-13 20:47:27
问题 Context Im writing a piece of code that has 1+ Sliders. These sliders form a group. The sum of the slider values of this group must always be 100. However, as a NEEDED feature, the user can disable and enable (add/remove) sliders from this group. Therefore, this requires that the sliders values get adjusted properly. After attempting to code my own group, I decided to look for a better/tested and implemented code. It improved from mine, however, some issues appeared. Primary Issue Adding or

Linked JSliders With Maximum Combined Value

不羁岁月 提交于 2020-01-13 06:56:10
问题 What's the best way to 'link' JSliders to put a cap on the combined value? Imagine a fighting game where the user can specify character traits like speed, agility, endurance and accuracy. The user is given 100 points to allocate however he chooses, but the total value of all the sliders must not exceed 100. That is, the sliders should not allow such increases. If the user has allocated 30 points each to speed, agility and endurance, then the slider for accuracy should allow a maximum of 10

Remove value displaying over thumb in JSlider

假装没事ソ 提交于 2020-01-13 03:07:09
问题 I have a little problem with my JSlider, that I haven't been able to solve. To explain the situation a little, I have to do a JSlider going from 0 to 20, through 0.1 steps. I tricked my way out of problems by creating a JSlider from 0 to 200, and redefined the labels under the slider to display the corrent percentages instead of the integer values. But I have one last problem : I'm using a custom L&F (that I can't change, obviously, as it is from the client), that displays the value over the

How can I change the size of a figure made in Java Graphics2D with a slider?

北城以北 提交于 2020-01-10 06:16:38
问题 I'm trying to make a program with java using Graphics 2D that paints polygons between 3 and 8 sides and that I can resized with a slider but I do not know how to do for change it size with the slider evenly. Here is a example of my pentagon drawn if (sides == 5){ g.drawLine(110+x,135-y, 10+x,205-y); g.drawLine(10+x,205-y, 48+x, 320-y); g.drawLine(48+x,320-y, 170+x,320-y); g.drawLine(170+x,320-y, 205+x,205-y); g.drawLine(205+x,205-y, 110+x,135-y); } Now I want to change its size evenly. (I can