Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Colored buttons on a Mac?



I think the thing is that Platinum buttons aren't supposed to have colors. It's probably in the Human Interface Guidelines somewhere. AWT Buttons, like most AWT widget classes, use the native UI toolset, and so take on the appearance of the platform they're running on. Native Platinum buttons don't have background color, so this behavior is correct, and more or less what you should expect.

If you really want to have colored buttons, implement a nice simple lightweight component (child of Canvas, for instance) that has button functionality, (generates an action event when clicked on, for instance, or if you want to get fancy, has highlight states and pays attention to mouse movement and pressed state,) then paint it however you feel like. There are probably several implementations of this sort of thing within a few browser clicks of where you're standing. Or use Swing; but if you're using MRJ 2.x Swing might not be your best option, since in my recollection the Swing support under MRJ (prior to OS X) didn't perform all that well.

Or ask yourself how much having color buttons really improves your UI.

-Ian

On Monday, May 14, 2001, at 02:02 PM, Claude Pany wrote:

on 5/14/01 8:14 AM, Robert Somerville at
email@hidden wrote:

I find making colored buttons very easy on a PC but not on a Mac. If this
was a MRJ fault then there would be complaints all over the Internet. I
can't find any so I must be doing something wrong. I am using MacOS 8.6 or
9.1, CodeWarrior Pro for Java R5 and MRJ 2.2.4. Here is my applet. It
produces a blue button with red writing on a PC but gray writing on a gray
button an a Mac. Does anybody have any ideas?

Yes, it's a well known MRJ limitation. Changing the background color on
Apple Platinum java.awt.Button components is probably quite difficult
(first, you would have to define precisely what that means). But changing
the foreground (text) color is not that hard. I put together the
(experimental) Colorfast Kit to prove that point. It also handles
java.awt.Checkbox components.

The kit is available here:

<http://www.tactix2000.com/colorfast_kit.html>

Claude
_______________________________________________
java-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/java-dev


References: 
 >Re: Colored buttons on a Mac? (From: Claude Pany <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.