Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 07-22-2006, 12:52 PM   #1 (permalink)
spidermo
Recruit
 
Join Date: Jun 2006
Posts: 14
spidermo is on a distinguished road
Arrow custom JSlider

I am wondering if it is possible to change the shape/size of the track and the knob of a JSlider. All I can find out how to do is add tick marks, labels, and make it longer. I am just wondering how to change the track display and the knobs display.
I am not sure as to how to go about writing my own JSlider class.
I have looked around quite a bit and have not found help.
Thanks if you have any suggestions.
spidermo is offline   Reply With Quote
Old 07-22-2006, 03:01 PM   #2 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,161
Belisarius is on a distinguished road
I'm not a Java GUI expert, so you might want to double-check what I'm about to say.

My impression is that no, there isn't a trivial way to change the look/feel of JSlider because you're using a look/feel theme that's suppose to convey uniformity across the application. If you want to change the way the individual components render, you need to use/develop a different look/feel and apply it to the whole application.
__________________
GitS
Belisarius is offline   Reply With Quote
Old 07-22-2006, 08:00 PM   #3 (permalink)
spidermo
Recruit
 
Join Date: Jun 2006
Posts: 14
spidermo is on a distinguished road
Yeah, that makes sense. Meanwhile, I have started to make my own simple replica jslider. It will work for what I am doing, but I think I will look into making a look and feel. But from what I have seen, it is a lot of work...
Thanks for your thoughts.
spidermo is offline   Reply With Quote
Old 07-23-2006, 02:41 PM   #4 (permalink)
spidermo
Recruit
 
Join Date: Jun 2006
Posts: 14
spidermo is on a distinguished road
I have found a solution. What I did is subclass BasicSliderUI() and override the getThumbSize() and the calculateTrackRect() methods. And then of course I applied it to the JSlider with setUI(SliderUI).
spidermo is offline   Reply With Quote
Old 07-23-2006, 04:35 PM   #5 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,161
Belisarius is on a distinguished road
Good hack. Keep it in mind if I ever program a GUI in Java again.
__________________
GitS
Belisarius is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom controls SLG29 MS Technologies ( ASP, VB, C#, .NET ) 0 11-25-2005 01:48 PM
ERROR: Uploading Custom Avatar infinite_root Feedback 6 05-17-2004 03:47 PM
Custom Component Phatslugga Java 4 04-13-2003 10:46 PM
Custom function bdl PHP 3 03-07-2003 05:53 PM


All times are GMT -8. The time now is 10:35 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting