jslider

JSlider question: Position after leftclick

Whenever I click a JSlider it gets positioned one majorTick in the direction of the click instead of jumping to the spot I actually click. (If slider is at point 47 and I click 5 it'll jump to 37 instead of 5). Is there any way to change this while using JSliders, or do I have to use another datastructure? ...

Change displayable labels for a JSlider?

I have a JSlider with a min of 0 and a max of 10,000. I have the major tick marks set at 1,000. If I were to paint the labels now they would show up as 0, 1000, 2000, 3000, 4000, etc. What I would like to be shown would be 0, 1, 2, 3, 4, 5, etc. What would be a good way to accomplish this task? ...

Java Swing Range Slider U.I.

Hello. I needed a slider with two knobs on it (representing a range) and I found this nifty one here. However, they created their own U.I. which extends Java's BasicSliderUI. They override the paint method to draw their own knobs. I would like to use the default knobs based on the current look and feel. I tried calling BasicSliderUI...

Changing a JLabel's Value from a JSlider's Value

I have a single JPanel that contains a JSlider and a JLabel. I want to configure it so that when the JSlider's value is being changed by the user, that new value is reflected by the JLabel. I understand that I can fire ChangeEvents with the Slider, but I don't know how to add a ChangeListener to the JLabel. Here's a snippet of my code. ...

Overlay multiple JSliders in Swing

Is it possible to overlay multiple JSliders so I can see the "thumbs" on both (I've tried disabling the painting of the track and setting opacity to false but one still hides the other)? Basically I'd like to create a component that allows the user to define a range (and I didn't really want to write a custom one since it has most of the...

How to un-link a JSlider's progress indicator from its thumb?

I'm using a JSlider to show progress in my application, so that it updates as a certain process computes. I want a user to be able to drag the thumb backwards to a tick mark in the past, but when this happens, I want the progress indicator to remain at its current position. // A dismal attempt at drawing the situation Progress: ------...

Java: link JSlider and JTextfield for float value

what is the best and easiest way to link a JSlider and a JTextField so that if one changes, the other gets updated too, but there is no recursive loop? thanks! ...

Mimicking Zoom bar from Office 2007 in Java (Modified JSlider)

Hi guys, I'm attempting to mimic (or find a preexisting component) that mimics the zoom slider from Word 2007: There are two main differences between this component and a standard Java JSlider: Does not snap to ticks except at 100%, and snaps while you're sliding the bar rather than when you release mouse Slider is not linear the ...

Updating position of JSlider Swing

My apologies for posting tons of questions as of late. I'm trying to get a JSlider to update its position based on a constantly updating variable. The setValue(n) method doesn't seem to work. Is there any alternative? We're using this as a time marker for a music player. ...

JSlider key bindings

So I'm a bit nonplussed at the JSlider default key bindings for vertical sliders. Home: goes to the bottom (why not the top?) End: goes to the top (why not the bottom?) PageUp/PageDown: direction good, but goes up by some amount K which I can't control up/down arrow keys: direction good, but goes up by 1, and I have a high-granularity ...

swing: JSlider but with coarse/fine controls?

I have a JSlider with 65536 different values. It works great for coarse adjustments and for very fine adjustments (+/-1 using up/down arrow) but is very poor in the middle. Is there anything out there that would be better? I can vaguely imagine taking 2 sliders one for coarse + fine adjustments, but can't really figure out how to get th...

Custom Jslider Initialization Problem

I am working on a custom JSlider that has a custom Track Rectangle. I want the ability to set the color of the track rectangle when first declaring the slider. Here's a snippet of what I have (The classes are in separate files in the same package): public class NewSlider extends JSlider { Color kolor; public NewSlider (Color k) { ...

is the stocktwits live streaming slider the jquery widget slider?

i'm trying to add a slider similar to the "live stream" slider over at www.stocktwits.com. i've found a ton of jquery slider widgets but none exactly like this. and looking at the code it look like it's actually a jflow plugin. but then looking at jflow plugins on the net it doesn't seem like it's exactly that either. what plugin is ...

JSlider for doubles

Hi, I am making a GUI (using swing) for a poker framework and need some sort of slider to allow players to select a bet size. However the Swing JSlider only works with int values whereas i need something that can support doubles for 1 decimal point. Are there any libraries I can use, or tricks with the JSlider? Thanks ...

Java Swing - JSlider and JCombobox causing runtime errors

Ok, I will post the code for the three classes as it's not too long. package guiDemonstration; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; public class TabbedGUI { //create fields private JFrame frame; private JTabbedPane ...

getting JSlider bar to move on mouse click event

Hi, I have a JSlider which shows bet sizes (for a poker game) I am trying to achieve the effect that when a mouse click occurs the slider jumps forward by a bet amount (i.e. a big blind amount) rather than just incrementing by one. If the mouse click happens to the left of the bar i want it to decrement by a fixed amount else increment...

Java Swing - Drawing markers on JSlider.

Hi, I have a progress bar which inherits from JSlider to provide highlighting functionality. Highlights can be added to the slider at a point (and a Color) and these are then painted onto the control. As follows: The problem is that I cannot get the highlights in the right place, they need to be in the same location as the markers. I...

Multi-value JSlider component?

I need a multi-value JSlider (or a similar component) for an analysis application. The two features missing from the regular JSlider are the ability to have more than one knob and also the ability to add or remove knobs on the fly. The reason for this is that they will be used to partition the 0..100% range for a particular factor into t...

Changing Button Attributes to Match Slider Window

Greets, First - this site is incredible. I've learned a ton of great things here! I'm using a jquery based slider program to display a sequence of pictures (a series of books). Beneath the slider window I've positioned a "PDF" buttons. I'm trying to sort how to have the button download the file associated with whatever image is curren...

Changing the width of a knob on a JSlider

Ok, so I have searched google for a while now to see if I can find the answer to this but no dice. Maybe I am just searching for the wrong thing but this is what I want to know: How do you change the width of the actual Knob on the JSlider component? NOT how to change the width of the JSlider. Any help would be greatly appreciated! ...