0

I am developing a RCP application where I want to add a button which look like apple os button. I want this look in windows7. Is this possible ?

4

1 に答える 1

0

Yes it is possible, but as the commenters have mentioned, definitely not recommended. SWT will not support this out of the box, as it is designed to have native looking widgets on whatever platform it is running on.

Swing, on the other hand, supports many different types of "look and feel", since it is designed to look the same on whatever platform you are running on. It won't be perfect (since again, it's not the native widget), but it's easier than writing your own widget.

Your options are:

  1. Use Swing for your widget. This related answer and this look and feel documentation are good starting points for doing this. There may be other look and feel implementations available that do a better job.
  2. Write a custom SWT widget that happens to look and feel like the button you want. This is pretty much extending from either Composite or Canvas, and implementing all the painting and behaviors yourself.

Keep in mind that with both of these solutions, your button will very quickly look out of date on newer versions of the OS if the native rendering of the button has changed.

于 2014-02-12T04:10:47.213 に答える