My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
Examples  

Featured
Updated Aug 21, 2009 by kenneth....@gmail.com

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 6, 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 vizt...@gmail.com, 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 oliviera...@gmail.com, 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 jbhawe...@gmail.com, Oct 2, 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 nemo2...@gmail.com, Nov 2, 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 guid...@gmail.com, Nov 5, 2009

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

Comment by mahm...@gmail.com, 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 = ????

Comment by lasse.vi...@gmail.com, Dec 10, 2009

Hi, great library but...

...I have a little problem:

Have a JFrame with a KeyListener? and it works great until I add either a SourceList? or a UnifiedToolBar?. They seams to block the listener. Works fine with a MouseListener? but that won't help me out :)

Thanks in advance

Comment by FrancescoGarbin@gmail.com, Jan 14, 2010

Congrats, a really nice library. I hope you'll keep maintaining it!

Comment by encaputxat, Feb 5, 2010

new idea, I have a SourceLists? with "users" for example, how hard is create a new component for when I click one one item from iTunesTable, see details on square at bottom left like itunes cover.

The same idea can found in iphoto for photo details.

Comment by vivekmoy...@gmail.com, Apr 2, 2010

Hello I am having a problem that when i run it is not showing the rounded corner window it shows some black spot at the end and it look like a square or a rectangle

Comment by JakeTyo, Jun 1, 2010

Im having a problem adding these to a content pane... I tried to use .add() to add them, but it doesn't work. Also I have checked the Javadocs and there is almost no information on this. Please help?

Comment by pan...@me.com, Aug 6, 2010

Same issue as 'JakeTyo?'. I've tried adding different components from this library, but nothing shows up in the frame.

CODE:

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?()); this.add(sourceList.getComponent(), BorderLayout?.WEST);

'this' is the JFrame.

Comment by seth.sch...@gmail.com, Aug 17, 2010

wonderful wonderful project. thank you so much for the work. It is nice to see Swing used to it's potential

Comment by yair...@gmail.com, Aug 20, 2010

Like pan...@me.com and JakeTyo?, I also didn't see anything until I have tried a different layout.

panel.setLayout(new BoxLayout?(panel, BoxLayout?.Y_AXIS)); ...

panel.add(sourceList.getComponent());

Hope it helps

Comment by real...@gmail.com, Sep 26, 2010

nice work

Comment by ismae...@gmail.com, Jan 5, 2012

I know this is old, but could you make some more examples? This is still a great work and i would appreciate some more information so i can use it

Comment by johncard...@gmail.com, Apr 24, 2012

Hi there, first of all: awesome widgets, really elegant, great work, guys. I've been trying to use your widgets but I haven't been able to find any examples of how to use them. Is there any example available which shows the use of your widgets? Thank you very much...

Comment by elid...@gmail.com, May 9, 2012

How can i create a jframe that looks like this?

Comment by elid...@gmail.com, May 14, 2012

as a beginner in programming, we really BADLY need chunks of code for utilizing these awesome stuff. hope you can reply... thanks!


Sign in to add a comment
Powered by Google Project Hosting