Controlling the knob of a JScrollPane

I have a JTable inside a JScrollPane.
When starting the program the horizontal knob is at its left-most position.
The JTable is larger than the JViewPort, hence only the top left area of the JTable is visible.
Using the mouse pointer I can drag the horizontal knob towards the right, hence scrolling the JTable.
Now that I have manually scrolled my JTable, I want to click on the contents of one cell of the JTable and do some actions.
The problem is that, as soon as I click on the JTable, the horizontal knob moves back to its original left-most position and the JTable gets scrolled back to its left corner again.
How can I keep the horizontal knob in the position that I set manually with the mouse pointer?
in other words...
How can I keep the horizontal knob in the position where it was before clicking in the JTable ?

Following the sugestions given by: StanislavL and akhalil100, I have inseterd the following code when creating the JScrollPane for the first time:
          theJScrollPaneOfCandidates.setMinimumSize( new Dimension(50, 50) );
          theJScrollPaneOfCandidates.setPreferredSize( new Dimension(125, 125));
          theJScrollPaneOfCandidates.getHorizontalScrollBar().setValue(500);
          * Now I am going to test if the JScrollPane has the good Value
          int theValue = theJScrollPaneOfCandidates.getHorizontalScrollBar().getValue();
I have a breakpoint placed after the last line of code, to be able to see the contents returned by getValue().
Now this is the strange behaviour:
It works when I try to set a value =< 90, but it does not work for values larger than 90.
In more detail:
I can setValue between 0 and 90 and a get the same value from getValue.
But if a setValue larger than 90, then the getValue returns always 90.
In particular, if you see the code above, I setValue(500) and in the next line of code the getValue() method returns to me 90.

Similar Messages

  • Can I control the plug ins parameters with a single knob?

    I have a question for garageband users. I have the iControl from m-audio to control the paramteters of a plug in but most of the times the knobs don't correspond and it takes a lot of times to figure out which knob controls what. So I use iControl mainly for play rec and the scroll wheel is very helpful. I also use metric halo ChannelStrip and it has a lot of parameters. With this plug in and many other when you put the mouse over a knob you can control it by turning the arrow up down, I find this very imprecise and I would like something else. Is it possible to click with the mouse on a parameter knob of a plug in and increase or decrease it with an external knob?
    I don't know if my question is clear, may be it's possible to do that with some midi programmation?
    Thanks in adavance for all input
    Message was edited by: Louis Gagnon

    You have an overdetermined system. To exactly define one of three states, only two booleans are needed.
    Test for too low and too high and if both are false we are automatically in range, right?
    Here's what you could do.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    forum nov 14MODCA.vi ‏10 KB

  • Can't figure out how to set my midi controler to control the sampler!

    I have a Korg Kontrol49 and I want to be able to control the sampler knobs and faders with the ones on my Korg. I have it connected threw USB. It works for the keys but I can not figure out how to program the rest of it. Any help would be great. I tried reading everything I could to get it to work but I cant. Please help!
    Thanks
    Mac Pro   Mac OS X (10.4.8)  

    Press Command-L. Touch the onscreen control. Twiddle your MIDI knob. Assignment learnt.
    Then go read the manual on Controller Assignments...

  • How to make the knob of a horizontal Scroll Bar stay at right

    Hi I need some advise to achieve this:
    I have a chart continuously deploying towards the right side (think on an electro cardiogram that is continuously feeding data). All the chart information is kept available inside a JScrollPane. What I want to achieve is:
    1. if the horizontal scroll bar knob is at the right end of the scroll bar make the end part of the chart be displayed continuously (view is scrolling to the right, the knob stays at the right end)
    2. if the user moves the knob left from the right end freeze the motion and just show the selected portion (meanwhile data keeps being fed and stored but not displayed)
    3. when the user decides to drag the knob again to the right end the behavior of point # 1 resumes.
    The basic swing structure I'm using for this is the following:
    public class Electro extends JPanel {
    public Electro() {
    JFrame f = new JFrame();
    JScrollPane sp = new JScrollPane(this);
    f.getContentPane().add(sp);
         f.pack();
         f.setVisible(true);
    I would highly appreciate any feedback from fellow members. Thank you.

    hi friend
    try this in ur code
    public class Electro extends JPanel {
    public Electro() {
    JFrame f = new JFrame();
    JScrollPane sp = new JScrollPane(this);
    sp.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    sp.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    f.getContentPane().add(sp);
    f.pack();
    f.setVisible(true);
    i think it will be help full to you
    thanks
    waiting for reply

  • How can I control the delay pedal with a MIDI keyboard?

    Okay, I'm looking to perform the song 'Are You In?' by Incubus with some friends, and here's what I want to do...
    I have my guitar plugged into a Behringer UCG102 Guitar Link
    The link is then plugged into my MacBook running GarageBand
    I have an amp preset saved in the program with the 'Blue Echo' delay pedal
    While playing, I want to be able to use my external MIDI USB keyboard (Akai MPK25) to control the 'Time' and 'Repeats' knobs on the virtual pedal.
    Otherwise, i'm gonna have to keep switching between playing guitar and clicking on the screen and then moving the mouse around frantically.
    How can I do this? And is it even possible in GarageBand?
    If not in GarageBand, is it possible to do the same in Logic Pro?
    My Akai keyboard did come with a piece of software to control the keyboard from the computer. It allows me to save different presets and upload them to it. For the knobs on my keyboard, the software has the option to enter numbers next to each knob for 'CC', 'Low' and 'Hi'
    Sorry if i'm not very clear or I don't make much sense, not really sure how to explain everything.

    There are two types of sustain pedal... One's with  + polarity and ones with - polarity
    The sustain pedal you are using, has the oppostie polarity from the standard.. which means when you press it it acts as if it is not pressed and vice versa...
    Unfortunately, unlike a lot of keyboards...  the Launchkey doesn't provide a setting that allows you to correct this issue... which means that unless the pedal you are using has a built in polarity switch...(In which case power down your keyboard, unplug the pedal and select the opposite setting to what is set now and then plug it back in and power up your keyboard) your sustain pedal is the wrong type and is not compatible with the Launchkey....
    Failing that, here is an example of a sustain pedal that has a polarity switch so you can use it with any keyboard....
    http://www.amazon.com/gp/product/B00063678K/ref=oh_aui_search_detailpage?ie=UTF8 &psc=1

  • Manually controlling the front panel without a keyboard

    Hi all,
    In my application I constantly switch the keyboard and the mouse between two computers (using a KVM switch), but would like to continuously be able to control a numeric control on the front panel of one of the computers (running LabView 6.1). Even if I wasn't switching, the use of the keyboard is awkward, since the control needs to be fairly effortless, quick and smooth. After searching a bit for a knob/wheel/dial type of controller, I was only able to find the new PowerMate (Griffin Technology) as a reasonable candidate, and have yet to purchase and try to integrate it. I'm also not sure how it will work with LabView.
    Am I overlooking a simple solution?
    Anyone have some experience with the Pow
    erMate?
    many thanks, Shy

    Another option: Create a simple TCP/IP application in VB or LabVIEW to
    control the control.
    That is,
    Monitor for incoming TCP/IP data in the VI with the control.
    If on your other computer you wish to make a change, just use your
    little application to do it, and send the value to the main app.
    Very cheap to do =)
    Another option 2:
    Grab the available Parallel Port digital interface design specifics for
    labview. Create yourself a simple binary switch interface. Assign 4
    bits for up and 4 bits for down.
    That is,
    sw1 = -10
    sw2 = -1
    sw3 = +1
    sw4 = +10
    Read in the digital input from the parallel port and increment your
    control accordingly. You can obviously assign any values you want to
    the digital inputs.
    Hope this helps guide you a little bit!
    Sincerel
    y,
    Jason G Richmond
    Project Engineer II and LVAAD Instructor
    VI Engineering
    [email protected] (domain should be vieng.com (no A's))
    sshoham wrote:
    > Hi all,
    >
    > In my application I constantly switch the keyboard and the mouse
    > between two computers (using a KVM switch), but would like to
    > continuously be able to control a numeric control on the front panel
    > of one of the computers (running LabView 6.1). Even if I wasn't
    > switching, the use of the keyboard is awkward, since the control needs
    > to be fairly effortless, quick and smooth. After searching a bit for a
    > knob/wheel/dial type of controller, I was only able to find the new
    > PowerMate (Griffin Technology) as a reasonable candidate, and have yet
    > to purchase and try to integrate it. I'm also not sure how it will
    > work with LabView.
    > Am I overlooking a simple solution?
    > Anyone have some experience with the PowerMate?
    >
    > many thanks, Shy

  • How do I use the time capsule to share itunes music between multiple apple devices? Also, is it possible to control the music on one device using another, and how do you set this up?

    How do I use the time capsule to share itunes music between multiple apple devices? Also, is it possible to control the music on one device using another, and how do you set this up?

    unless i'm missing something, i think you got mixed up, this is easy google for walk throughs
    i'm assuming this is the new 3tb tc AC or 'tower' shape, if so, its wifi will run circles around your at&t device
    unplug the at&t box for a minute and plug it back in
    factory reset your tc - unplug it, hold down reset and keep holding while you plug it back in - only release reset when amber light flashes in 10-20s
    connect the tc to your at&t box via eth in the wan port, wait 1 minute, open airport utility look in 'other wifi devices' to setup the tc
    create a new wifi network (give it a different name than your at&t one) and put the tc in bridge mode (it may do this automatically for you, but you should double check) under the 'network' tab
    login to your at&t router and disable wifi on it
    add new clients to the new wifi network, and point your Macs to the time machine for backups

  • Remotely control the ITunes on Windows 7 64 bit PC with the new IPad

    With the latest version of ITunes for both Win7 and the new IPad, I'm only able to use the new IPad to remotely control the ITunes on Windows 7 64 bit PC through wired connection  ( ethernet cable ) to the wireless router. As soon as I connect my PC through wireless connection, the new IPad can not find my libraries.
    Is this a known issue or am I missing some settings?
    Thanks,

    Are you using the 64 bit installer?
    See also  Recovering your iTunes library from your iPod or iOS device.
    tt2

  • The sound of my iphone has dissapeared when I play games and when i listen to muisic but when I put the headphones the sound come back and I can control the sound,what should I do??

    I was on a boat ride when some water fell on it but it was just a little bit then when i tried to control the sound and volume while playing and listening to music it didn't showed anything and just with headphones it appeared again and i could listen and I could control it again but when i take the headphones out it goes back to the same thing.What should I do??

    try toggling the Ducking menuItem

  • Can not control the color in JOGL

    I am a beginner to use JOGL.
    I find that I can not control the color, both background and foreground. The background is always Black, and foreground is always Red.
    I use canvas.setBackground(Color),
    gl.glColor3*(), trying to change the color. But it does not work.
    What is the problem?
    Thanks.
    Toby

    A big help for learning JOGL is reading the Red Book from OpenGL, which can be downloaded in pdf. Since JOGL is almost a direct wrapper, the function calls are identical.
    To set the background color, you need to add a GLEventListener to the GLCanvas that you're using. To set the background color, in your init() method for GLEventListener do:
    public void init(GLAutoDrawable glad) {
    GL gl=glad.getGL();
    gl.glClearColor(r,g,b);
    or something similar, I'm not on my normal computer so this was all from memory. Check the JOGL API for the exact method name for glClearColor. To change the foreground color, there are a bunch of various methods that are all similar to glColor3f(float r,float g,float b).
    Calling this on the GL object in the display() method will set the foreground color and everything drawn that isn't using lighting will use this color.

  • I want to make a slideshow to view on my television with image's duration ranging from seconds to an hour or more and I want to use my iPhone or iPad mini to control the television through my Apple tv.  I've been unable to locate an app that will do this.

    I want to make a slideshow to view on my television with image's duration ranging from seconds to an hour or more and I want to use my iPhone or iPad mini to control the television through my Apple tv.
    I've been unable to locate an app that will do this.  The Photos app that comes with the phone or iPad has extremely limited duration controls.  PhotoStream seems to load everything from my phone or iPad not allowing me to just load up a set group of images.
    iPhoto for iPad is getting some terrible recent reviews.  I tried a couple other free apps but they don't use Airplay.
    I can do something like this with iPhoto and my MB Air, but it's kind of ugly to have the computer open in order to connect by Airplay to my Apple TV.  I've thought the iPad or iPhone would be a lower profile controller.
    Am I out of luck?

    Thanks for your help.  Since I'm uninterested in loading all my photos (the only option) into photostream, I won't be able to use the settings in ATV.  I guess I'm just stuck with using iPhoto on my MB Air.  Thanks again.
    paul

  • Control the opening and closing period

    hi ,
    Control the opening and closing period
    How I can control open and close peroid at the level of (ledger or legal entity or operating unit)
    thanks

    can you clarify it, what does it mean 'control' the opening period

  • Allow the user to control the width of the edit forum post input box

    I would like to control the width of of the edit-forum post input box.  This could be:
    automatically adjust the width of the box so that the box doesn't run off the right edge of the window.
    have a user global preference to set the preferred width
    at least, allow the user to change the width via the change size icon.  The three horizontal bars at the lower left of the input box. You can adjust the vertical dimension, but not the horizontal. TenFourFox 4.0.1. This is probably being blocked for some obscure reason.
    Here is an example of an over extended right margin:
    Curiously enough, the "software" let's me adjust the width & height of the add reason to edit text, but not adjust the width of the more important edit text box.
    Robert

    Testing
    Standard Reply box can be height adjusted but not width.
    Same with Advanced Editor
    No Adjustment at all in HTL Editor
    Edit.
    The Edit uses the Advanced Editor
    Only Height Adjustment again.
    I do seem to remember someone posting about the width and saying they could drag it over the edge of the right hand edge (Into the grey surround)
    This may have been a post in the lounge.
    It didn't actually try it at the time but have played with it since and have not seen it.
    Maybe it is something they "Fixed" in both senses of the word.
    Second edit.
    I can't alter the box that currently reads "Message Edited by:- ..."
    I also can't get this box to accept New lines  (they appear in the box but don't post that way)
    Corrected Spelling
    9:51 PM      Wednesday; May 11, 2011
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb( 10.6.7)
     Mac OS X (10.6.7),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously
    Message was edited by: Ralph Johns (UK)
    Message was edited by: Ralph Johns (UK)
    and new line with a line space as well

  • Control the creation of excise invoice without chapter id

    Hi All
    If Chapter ID is not maintained for a material in J1ID, can we control the creation of the sales excise invoice (J1IIN) for that particular material.
    Thanks in advance
    regards
    Ram A

    Hi Rajesh
    Thanks for your reply.
    Eventhough the chapter ID is not maintained in the Material Master or in J1ID, the system will allow the creation of the sales excise invoice (J1IIN) without any excise duties in case of TAXINJ and with excise duties in case of TAXINN.
    My requirement is that the system should restrict the creation of sales excise invoice for the materials without chapter ID.(Any User exits ???)
    regards
    Ram A

  • Can 2 iPhones control the same iTunes Library with Remote?

    Hi,
    Does anyone know if you can authorize 2 iPhones to control the same iTunes library using the iPhone Remote app? Or can only one iPhone be authorized at any one time?
    Thanks!
    - John

    Hey John,
    Yes, you can have multiple iPhones remote controlling iTunes.
    Jason

Maybe you are looking for

  • Need urgent help with a new Z program please

    I have to write a program that finds files matching some pattern, for example I have files test1,test2,test3 in a directory then if I pass test* as parameter it should find all the files i.e, test1,2,3. I have to then store the files in internal tabl

  • Amount collected per sales office

    hello Is there any report whereby I can get amount collected by each sales office ?

  • Possible to make a guide into a mask or selection?

    Is this possible? I want to use a guide made from an object, as a cookie cutter for an image that I've placed under it. thanks!

  • Which framework you finds better?

    Hello, which framework you finds better? Struts Chale WebWork Spring JSF

  • Final Cut Express Rendering Issue

    If I sometimes make revisions to a clip that was rendered some time ago, and then re-render, the previous render result is not replaced by the new render. How can I fix this? Is there a way to un-render a previously rendered clip?