What is an example of a task based UI?

The easiest way to generate a task based UI is to protect all attributes/properties of your models. i.e. remove all setters. From this (pseudo code): public class TodoTask { public Date getDateAssigned(); public void setDateAssigned(Date); public string getAssignedTo(); public void setAssignedTo(string); } to this: public class TodoTask { public Date getDateAssigned(); public string getAssignedTo(); public … Read more

Programmatically Centering UIViews

In addition to what @Jasarien and @Brad have said, don’t forget that you can force auto-centering using the Autosizing springs and struts. Essentially (in Interface Builder) you click around until there are no Autosizing lines visible, like this: alt text http://gallery.me.com/davedelong/100084/Screen-20shot-202010-03-26-20at-2010-49-18-20AM/web.jpg?ver=12696222220001 In code, you set the -[UIView autoresizingMask] to: Objective C : (UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin … Read more

Change background color of NSButton

Assuming everything is hooked up in IB for your borderless button. // *.h file IBOutlet NSButton* myButton; // *.m file [[myButton cell] setBackgroundColor:[NSColor redColor]]; Note from the setBackgroundColor documentation: “The background color is used only when drawing borderless buttons.” If this won’t do it for you then you’ll need to override NSButton and implement the … Read more

Please recommend pretty Java Swing components library [closed]

Why not use the standard java Look and Feels there are plenty: JGoodies JTatoo Jide look and feel Liquidlnf Napkin LaF PgsLookAndFeel Quaqua (looks like aqua from MacOS X) Seaglass The Alloy Look and Feel The native for your system The nimbus LaF The substance project (forked into the Insubstantial project) WebLookAndFeel Also see here … Read more

How do I pick up the Enter Key being pressed in JavaFX2?

I’m assuming you want this to happen when the user presses enter only while the TextField has focus. You’ll want use KeyEvent out of javafx.scene.input package and do something like this: field.setOnKeyPressed(new EventHandler<KeyEvent>() { @Override public void handle(KeyEvent ke) { if (ke.getCode().equals(KeyCode.ENTER)) { doSomething(); } } }); Using lambda: field.setOnKeyPressed( event -> { if( event.getCode() … Read more