Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Re: newbie question: Problem creating a myJButton class

Reply
Thread Tools

Re: newbie question: Problem creating a myJButton class

 
 
Johan
Guest
Posts: n/a
 
      06-27-2003
Pete, thanks for Your reply.
I've also changed the color to one of the 'default' colors and it works
fine. Does anybody know why it's not working with a custom color? I'd realy
like to know because I prefer my custom colors above the default ones.

Thanks.

Johan

pete kirkham wrote:
> Johan wrote:
>
>> Sergio, thanks for Your reply. I've done what you suggested,
>> unfortunately it didn't solve it

>
>
> That's odd, it works fine on my machine with:
>
> private void jbInit() throws Exception {
> this.setBorder(null);
> this.setPreferredSize(new Dimension(128, 64));
> this.setBackground(beige);
> addMouseListener(this);
> }
>
> But I had to change the colour of the border to have a noticable effect,
> a one pixel border of very nearly the same intensity as the ground
> doesn't show up that well.
>
>
> Pete
>


 
Reply With Quote
 
 
 
 
pete kirkham
Guest
Posts: n/a
 
      06-27-2003
Johan wrote:
> Pete, thanks for Your reply.
> I've also changed the color to one of the 'default' colors and it works
> fine. Does anybody know why it's not working with a custom color? I'd
> realy like to know because I prefer my custom colors above the default
> ones.


It does work for custom colours.

If you make a really wide border (eg:
BorderFactory.createLineBorder(light_blue, 12) ) then you can see the
change.

The eye resolves detail, such as a one pixel border, by intensity rather
than colour. Colour is then applied by the brain to the edges of the
detail. This is why cartoons drawn with black outlines and solid colour
interioirs look like idealised real world things, not just wierd.

The difference in intensity can be calculated approximately* by:

|(238,236,223)| - |(232,237,255)| 403 - 418 15
--------------- --------------- = --------- = --- ~= 3.4%
|(255,255,255)| |(255,255,255)| 442 442

Which just isn't enough to notice for a one pixel detail on most monitors.


Pete

*the eye actually weights red, blue and green levels differently to each
other and dependent on ambient light

 
Reply With Quote
 
 
 
 
Johan
Guest
Posts: n/a
 
      06-27-2003
Thanks Pete.

pete kirkham wrote:
> Johan wrote:
>
>> Pete, thanks for Your reply.
>> I've also changed the color to one of the 'default' colors and it
>> works fine. Does anybody know why it's not working with a custom
>> color? I'd realy like to know because I prefer my custom colors above
>> the default ones.

>
>
> It does work for custom colours.
>
> If you make a really wide border (eg:
> BorderFactory.createLineBorder(light_blue, 12) ) then you can see the
> change.
>
> The eye resolves detail, such as a one pixel border, by intensity rather
> than colour. Colour is then applied by the brain to the edges of the
> detail. This is why cartoons drawn with black outlines and solid colour
> interioirs look like idealised real world things, not just wierd.
>
> The difference in intensity can be calculated approximately* by:
>
> |(238,236,223)| - |(232,237,255)| 403 - 418 15
> --------------- --------------- = --------- = --- ~= 3.4%
> |(255,255,255)| |(255,255,255)| 442 442
>
> Which just isn't enough to notice for a one pixel detail on most monitors.
>
>
> Pete
>
> *the eye actually weights red, blue and green levels differently to each
> other and dependent on ambient light
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
using std::map in a template class, getting LNK2019 link error when creating an object from this template class girays C++ 1 01-20-2007 09:47 PM
Class A contains class B, class B points to class A Joseph Turian C++ 5 12-30-2005 03:24 PM
Nested Class, Member Class, Inner Class, Local Class, Anonymous Class E11 Java 1 10-12-2005 03:34 PM
Creating inherited class with set base class Josh Mcfarlane C++ 2 08-18-2005 05:31 PM
A parameterized class (i.e. template class / class template) is not a class? christopher diggins C++ 16 05-04-2005 12:26 AM



Advertisments