Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Java Swing Thermometer - how do i do this?

Options
  • 03-02-2004 7:22pm
    #1
    Closed Accounts Posts: 536 ✭✭✭


    Calling all Swing Gurus! ;)

    What I'm trying to do is draw a thermometer and have a trigger slider which I can slide up and down to set the max temperature allowed before an alert is given.
    I'm at a bit of a loss as to how I should approach this.

    Is is possible to customize either the JScrollbar or JSlider classes to do what I want?
    Or should I be looking at JLayeredPanes or using Drag and Drop classes?


    Any suggestions or even general directions would be greatly appreciated.


Comments

  • Registered Users Posts: 885 ✭✭✭clearz


    I would just extend a JPanel and add a JSlider to the right, draw a thermometer on the left and add the needed methods.


  • Registered Users Posts: 6,316 ✭✭✭OfflerCrocGod


    Or use NetBeans automatic code generation for GUI stuff stick in events were neccesary and then just copy all the code into whatever app you are using as your IDE.


  • Closed Accounts Posts: 536 ✭✭✭flyz


    I have my thermometer drawn with a slider now.

    it's more like a red line with a JSlider on top but it does the job ;)


    Now I need to figure out how to customize the knob of the slider.
    I've looked at the SliderUI class but I can't make head or tail of it.

    anyone know of any good tutorials / examples I could look at to customise my jslider?


  • Registered Users Posts: 885 ✭✭✭clearz


    Originally posted by flyz
    I have my thermometer drawn with a slider now.

    it's more like a red line with a JSlider on top but it does the job ;)


    Now I need to figure out how to customize the knob of the slider.
    I've looked at the SliderUI class but I can't make head or tail of it.

    anyone know of any good tutorials / examples I could look at to customise my jslider?

    Look at the decorator design pattern


Advertisement