My favorites | Sign in
Project Logo
                
Search
for
Updated Aug 21, 2009 by kenneth.orr
Labels: Featured
Examples  

iTunes Table (Javadoc)

Create an iTunes style table like this:

String[][] data = new String[][]{
        {"A", "B", "C"},
        {"D", "E", "F"},
        {"G", "H", "I"}};
String[] columnNames = String[]{"One", "Two", "Three"};
TableModel model = new DefaultTableModel(data, columnNames);
JTable table = MacWidgetFactory.createITunesTable(model);

you can add sort indicators by doing this:

TableUtils.SortDelegate sortDelegate = new TableUtils.SortDelegate() {
        public void sort(int columnModelIndex, TableUtils.SortDirection sortDirection) {
            // initiate your sorting here.
        }
    };
TableUtils.makeSortable(table, sortDelegate);

HUD Style Controls (Javadoc)

HUD style controls should be used in conjunction with HUD windows.

JLabel label = HudWidgetFactory.createHudLabel("Label");

JButton button = HudWidgetFactory.createHudButton("Button");

JCheckBox checkBox = HudWidgetFactory.createHudCheckBox("Check Box");

JComboBox comboBox = HudWidgetFactory.createHudComboBox(
        new DefaultComboBoxModel(new String[]{"Item One", "Item Two", "Item Three"}));

JTextField textField = HudWidgetFactory.createHudTextField("Text field");

Dark Source Lists (Javadoc)

The SourceListDarkColorScheme can be installed on SourceLists used in applications where focus on content is critical, like photo editing applications.

SourceListModel model = new SourceListModel();
SourceListCategory category = new SourceListCategory("Category");
model.addCategory(category);
model.addItemToCategory(new SourceListItem("Item"), category);
SourceList sourceList = new SourceList(model);
sourceList.setColorScheme(new SourceListDarkColorScheme());

iApp Scroll Bars (Javadoc)

iApp style scroll bars can be seen in various Apple applications, most notably iTunes.

Using iApp scroll bars with a JScrollPane

JScrollPane scrollPane = new JScrollPane(someComponent);
IAppWidgetFactory.makeIAppScrollPane(scrollPane);

Using iApp scroll bars with a SourceList

sourceList.useIAppStyleScrollBars();

Heads Up Display (HUD) (Javadoc)

HUDs, also know as Transparent Panels, (descibed here in the Apple Human Interface Guidelines) provide a way to unobtrusively display transient information.

Simple HUD example:

HudWindow hud = new HudWindow("Window");
hud.getJDialog().setSize(300, 350);
hud.getJDialog().setLocationRelativeTo(null);
hud.getJDialog().setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
hud.getJDialog().setVisible(true);

Bottom Bar (Javadoc)

Bottom Bars (described here in the Apple Human Interface Guidelines) provide a mechanism to add controls to an application that affect the contents or organization of the window contents.

Simple Bottom Bar example:

BottomBar bottomBar = BottomBar(BottomBarSize.LARGE);
bottomBar.addComponentToCenter(MacWidgetFactory.createEmphasizedLabel("My Label"));

Source Lists (Javadoc)

Source Lists (described here in the Apple Human Interface Guidelines) are a way to navigate or select objects in an application. There are two types of Source Lists: focusable and non-focusable. Focusable Source Lists can receive keyboard focus, and thus be navigated with the arrow keys, whereas non-focusable Source Lists cannot be navigated with the keyboard. Here is a focusable and non-focusable Source List:

Simple Source List example:

SourceListModel model = new SourceListModel();
SourceListCategory category = new SourceListCategory("Category");
model.addCategory(category);
model.addItemToCategory(new SourceListItem("Item"), category);
SourceList sourceList = new SourceList(model);

Unified Tool Bar (Javadoc)

Unified Tool Bars (described here in the Apple Human Interface Guidelines) provide a container for the most frequently used tools in your application.

Simple Unified Tool Bar example:

// For some versions of Mac OS X, Java will handle painting the Unified Tool Bar.
// Calling this method ensures that this painting is turned on if necessary.
MacUtils.makeWindowLeopardStyle(frame.getRootPane());

UnifiedToolBar toolBar =  UnifiedToolBar();
JButton button = new JButton("My Button");
button.putClientProperty("JButton.buttonType", "textured");
toolBar.addComponentToLeft(button);

Comment by seiferttristan, Jul 06, 2009

You should try to make an App with macwidgets and QuAqua?! I tried it and looks like a mac on my Linux Machine!

Comment by viztang, Jul 21, 2009

Hi first of all, thanks for this brilliant widgets. They are very nicely designed.

I have two questions in regard to the HUDWindow:

  1. I add a scrollPane in the hubwindow component and it is not repainting properly. For example, I have to force it to repaint by clicking somewhere else. If I do a scroll with the scrollbar, the content will all messed up.
  2. 2. I try to setResize() to the hudWindow, but the corner icon will not be shown. Is there anything I need to pay attention to?

Again thanks much Sean

Comment by seiferttristan, Aug 24, 2009

The Resize thing was disabled for the HUDWindow because 1. Most HUD's are not resizable and 2. flickering / repainting issues

Comment by olivieramblet, Aug 30, 2009

Hi,

Great library and great doc, Thanks !

Two minor typo:

UnifiedToolBar toolBar = UnifiedToolBar(); should read: UnifiedToolBar toolBar = new UnifiedToolBar();

and

BottomBar bottomBar = BottomBar(BottomBarSize.LARGE); should read: BottomBar bottomBar = new BottomBar(BottomBarSize.LARGE);

Thanks again for this great lib

Comment by jbhawesis, Oct 02, 2009

I too must say that this is a great library!

I have a question that is not really an "issue", so I didn't want to cloud up your issue repository with something that I think might be trivial.

How do you detect which Category or Parent Item a Selected "Child" item is in? Effectively, I want to be able to render some kind of action based on the potential Category, or Parent as I might have a similarly named "Child".

For example, in Mail, there is the category "Mailboxes" and parent items of "Inbox", "Sent", and "Junk" the child items are my email "accounts". When you click on a particular account from a particular parent item, you go to the appropriate view. I'd like to mimic that behavior.

Also, just to be fair, I've spent most of my development life working on Web applications; Swing is a new beast to me, so perhaps the solution is easy and I'm just not familiar with it.

Thanks in advance!

Comment by nemo2080, Nov 02, 2009

hello and thankx for your work its amazing but is there any future component like the amazing ( mac menu in the bottom of the screen ) i searched a lot but i couldnt find one to use in my java programs

Comment by guidomb, Nov 05, 2009

There is an error in the example code. The line "UnifiedToolBar? toolBar = UnifiedToolBar?();" should be "UnifiedToolBar? toolBar = new UnifiedToolBar?();"

Comment by mahmud4, Nov 10, 2009

How can I use MacPainterFactory?() with JFrame to create header bar for a app? (i.e. )

JFrame frame = new JFrame();

MacPainterFactory? macPainter = new MacPainterFactory?(); macPainter.createTexturedWindowWorkaroundPainter();

frame.add(macPainter?????????);


How can I use ComponentTopBar?() with JFrame?

ComponentTopBar? topBar = ????


Sign in to add a comment
Hosted by Google Code