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: Eliminating focus ring space on Leopard & Java 1.5



On Oct 29, 2007, at 5:35 PM, Adrian Sutton wrote:

Hi Mike,

Try using some of these "JButton.buttonType" properties:
{ "segmented", "segmentedRoundRect", "segmentedCapsule", "segmentedTextured" }
with these "JButton.segmentPosition" properties:
{ "first", "middle", "last", "only" }

These properties are seriously cool, but I can only get them to work in a standalone application, not our applet (in either Safari or Camino). It's particularly odd because as a standalone application, the toolbar has a lighter color (same as the JMenu color), but in Safari and Camino it's much darker (same as the standard toolbar color in Safari, Mail etc).


In browsers, the icons always seem to render as rounded rectangles with a margin between each button. Also, for some reason in browsers the menubar in our applet has the old stripped look. Both standalone and the applet is running in Java 1.5.

Looks like applets get a different behavior out of the look and feel somehow which is really frustrating. They are both definitely using the same L&F class: Aqua Look and Feel for Mac OS X - apple.laf.AquaLookAndFeel

I'm sorry, I can't replicate this issue.

% cat Scrap.html
<title>Scrap</title>
<h1>Scrap</h1>
<hr>
<applet code=Scrap.class width=400 height=400>
</applet>
<br>

% cat Scrap.java
import java.awt.*;

import javax.swing.*;

public class Scrap extends JApplet {
	public void start() {
		main(null);
	}
	
	public static void main(String args[]) {
		JFrame frame = new JFrame();
		
		Container contentPane = frame.getContentPane();
		contentPane.setLayout(new BorderLayout());
		contentPane.add(createPanel(), BorderLayout.CENTER);
		
		frame.pack();
		frame.setVisible(true);
	}

	static Component createPanel() {
		JPanel panel = new JPanel(new FlowLayout());
		
		JButton b = new JButton();
		b.putClientProperty("JButton.buttonType", "segmentedTextured");
		b.putClientProperty("JButton.segmentPosition", "last");
		b.setPreferredSize(new Dimension(80, 30));
		panel.add(b);
		
		return panel;
	}
}

Perhaps you have some stale applet class caches. Just a thought.

Mike Swingler
Java Frameworks Engineer
Apple Inc.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >Eliminating focus ring space on Leopard & Java 1.5 (From: Steve Roy <email@hidden>)
 >Re: Eliminating focus ring space on Leopard & Java 1.5 (From: Mike Swingler <email@hidden>)
 >Re: Eliminating focus ring space on Leopard & Java 1.5 (From: Adrian Sutton <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.