The Source for Java Technology Collaboration


Home | Changes | Index | Search | Go

The SwingLabs Wacky Wiki

This page is used to capture exploratory and creative ideas for the future of SwingLabs. This is for jokes--all the ideas should be potentially realizable, just might be difficult to do or lower priority at the moment.

UI Components

Application Welcome Screen

A lot of applications these days open up to a "welcome" screen of some sort with various "What would you like to do?" options. Examples of such screens would be NetBeans when no projects are loaded (same thing for other IDEs such as Eclipse and IDEA), the MS Works/Office quick start panel, Intuit's global control panel in QuickBooks?, etc. It would be nice if there were a generic component for Swing that provided similar functionality. Ideally such a component would allow other modules (or plugins) to "contribute" to this welcome (or intro) screen (or at least utilize a "model" that could be easily implemented to collect options/links/whatever from other plugins to present to the "view"). Eclipse itself has an intro screen that other plugins can contribute to, for example, and may provide some useful ideas for implementation. This opening screen of the application will often be a user's first impression and so is a fairly important piece of the application. Moreover, new users may depend on this intro screen in order to begin using the application (to navigate which options are available and what they can do). The screen should also integrate keyboard and other shortcuts so that the welcome screen does not get in the way of more experienced users.

Data Display Components

I was really surprised when I went to look for these types of components and was unable to find them.
  • Data Slider: A slider type component meant to display data rater than accept input. A Data Slider is a component that uses a DefaultBoundedDataModel? (with minimum, value, and maximum) to display a range of data. SHould be able to optionally display Ticks and labels. SHould be able to display text in the middle of the slider itself, should be able to change the color of the slider based on a range (Green/yellow/red for instance). Think thermometer
  • Data Guage: A simple angular display approximating say a speedometer.
  • Level guage: similar to Data SLider but meant to display a series of discreet values rather than a continuous range. Think equalizer levels

rbair: Check out http://www.zvalley.com/wingz-widget-view.htm Their latest product release has some really excellent looking gauges

Framework Stuff

Utilities

Adapters

For the incubator: some standard adapters for known data sources (known format), such as Apache-format log files...not sure how we would package these, but would be pretty easy to code and nice to have lying around. Similar in a way to having parsers available for standard XML returned from RDBMSs. These adapters would then be used to read the source data into a DataSet? and DataTable?(s).

Common Validators

One-line factories for common data-entry validation: Validator v = StandardValidators?.get("us-zipcode");
  • phone numbers (varies by country)
  • US SSN
  • US Zip

Common Data Sets

Distribute small datasets for common cases, like country codes, US zip codes, etc. that are approved by international committees--the main thing is finding the files and downloading them, then writing a bit of documentation. The format would either be text file or XML, and data should compress well enough that you could just distribute all of them in one JAR, ZIP, or GZip file.
  • International country codes
  • Airport codes
  • US Zip Codes (or for other countries, where these are known and published).
  • IP Addresses

Common Translations

It'd be awesome if we had a jar containing resource bundles for common items such as "Cut", "Copy", "Paste", "Exit", "Start", "Run", "Open File", "Save As", etc etc, translated into as many different languages as possible.

Common Translations

We need to include a common set of cell editors/renderers for trees, tables, and lists. We should include:
  • Date Renderer/Editor
  • Currency Renderer/Editor
  • Formatted Renderer/Editor (based on locale)
    • This needs to take advantage of the AbstractFormatterFactory? enhancements listed on this page so we can support ip addresses, zip codes, numbers, etc
  • Slider RendererEditor?
  • Progress RendererEditor? (this one is iffy due to the dynamic nature of it -- need to solve the problem sooner or later though)

Report Maker

A different/unique approach to creating reports in Java. Whereas other frameworks (JasperReports?, in particular) take the approach of defining a new UI component heirarchy (vi XML, usually), this tool would use Swing directly. This has several advantages:
  • Rich UI (gradients, opacity, borders, fonts, icons, images, etc etc)
  • Ready use in any GUI builder
  • Easy to understand for Swing developers

BeanInfo? for SwingX? Components

All of our SwingX? components need a rich set of BeanInfos?. This will ensure that they work well out of the box for any GUI builder (Netbeans, JFormDesigner?, JDeveloper, JBuilder, probably even Eclipse, but I don't know their Swing GUI builder story). A starting point exists, but they need more detailed analysis and implementations.

JXFrame/JXDialog: setCancelButton and setDefaultButton

JFrame should support a simple "setCancelButton" method taking an AbstractButton? (although make clear in the documentation the JButton use case for new developers who might not know that JButton is an AbstractButton?). Likewise a setDefaultButton method should exist.

JXFrame/JXDialog: setKeyPreview(boolean b)

This comes from WinForms?. Essentially it is a simple boolean (setKeyPreview/getKeyPreview) that will turn on event handling for the JFrame so that whenever a keypress or related event occurs, it will be trapped by the JFrame and passed to some event handlers for dealing with. I believe there is a mechanism in Swing for doing this already (otherwise we wouldn't be able to trap the ESC key to close a frame/dialog), but IIRC it is rather involved and should be simplified

JXFrame/JXDialog: StartPosition?

A simple enumerated type on the JXFrame/JXDialog indicating where it should appear on the screen when shown. Values include: CENTER_SCREEN, CENTER_IN_PARENT, MANUAL, OS_DEFAULT.

JXFrame/JXDialog/JXPanel/JXTabbedPane/others?: setWaitCursorVisible(boolean b)

Designed to be toggled at runtime, this property affects the cursor for this component and all child components by making them use the wait cursor (if true), or restoring the cursor to its previous value for each component (if false). Simply acts as a useful toggle for a common use case.

JXFrame/JXDialog/JXPanel/JXTabbedPane/others?: setEnabled(boolean b)

Simple toggle to disable the JXFrame/JXDialog and all sub components (if false). When toggled to true after having been false, all of the components will be re-enabled to their former state. So, if I had a JFoobar component on my JXFrame and it was enabled, and I call form.setEnabled(false) then it will be disabled, and if I then call form.setEnabled(true) then it will be enabled. If, however, JFoobar started off diabled, then after the form.setEnabled(true) call, JFoobar would remain disabled.

JXFrame/JXDialog: setWaitPane(Container c)

This will end up being the GlassPane? to use when setWaitPaneVisible(true) is called. The old glass pane will be saved off, and replaced by c. When setWaitPaneVisible(false) is called, the other glass pane will be restored.

JXFrame/JXDialog: setWaitPaneVisible(boolean b)

Shows the wait pane, if there is one (if b = true), or hides it (if b = false). This method could also call setEnabled(b), and setWaitCursorVisible(b). Or, there should be another method that accomplishes this so that these 3 calls can occur by default together (which seems like a reasonable, common use case)

JXFrame/JXDialog: animate resize

In MacOSX?, there are times when a window (probably a dialog most of the time) will change its size based on a selection. For example, properties dialogs do this a lot. When you open a property dialog the contents of each sheet can be different sizes. So what OSX does is when a new property sheet/pane is shown, the dialog resizes to match. This would be really easy to accomplish, I think. What they do is that the new page is shown, and then the dialog has an animated resize to match the new page. This means the layout manager has to cooperate. Its kind of the inverse of what we normally do. Normally we have the layout manager adjust the contents to match the dialog -- what we sometimes want is for the dialog to match the layout manager. This should be possible by getting the preferred size of everything from the layout manager and then adjusting the dialog to that.

JXPanel/others?: add components using varargs

When hand-coding GUIs and putting together a panel of components, each component you add requires its own call to add(). Since we have varargs in JDK 5, we could add a version of add() which would take a vararg number of components, such that the entire list of components could be added in one go: panel.add(button1, button2, button3). Additionally, the panel constructor itself could have a vararg, so the panel could be constructed and populated in a single line: JXPanel panel = new JXPanel(button1, button2, button3).

JXGlassPane?

Simplified component to make it easier to write GlassPanes?. Romain has some tips for this (like managing opacity, etc). It would be good to have several default JXGlassPane? implementations/properties as well, such as FadeIn?/FadeOut GlassPane? (or properties on JXGlassPane?), JXInfiniteProgress? (extends JXGlassPane?), etc.

Better nonvisual components

Winforms beats us up in a couple of places in the UI builder department. One is a better set of nonvisual controls. I'd like to see things like SwingWorker?, ImageIcon?, Image, DataSet?, Timer (or better yet, TimingController? from timingframework.dev.java.net), HTTP, Help, TrayIcon?, etc all be normal, useable java beans with proper property editors etc for use within the GUI builder

JXYahooMap?

Or maybe not JX anything, but just YahooMap?. Provide a simple to use Swing component that has access to all the YahooMaps? functionality. Its just a JPanel with a special background, so you could build whatever components on top of it you want (including, push pins, images, buttons, etc etc).

JXChooser

We talked about this some time ago. Rather than taking a JComboBox? and extending it to support drop down tables and such, it would perhaps be better to have a JXChooser component that would be more flexible than JXComboBox?. Details are sketchy at this point.

JXAccordian

Bino wrote one of these once upon a time -- we should see if we can round it up. Like the JXTaskPane? in purpose, different in visual appearance/use. This type of component has a stack of buttons, when you click on a button all the other buttons either go to the bottom or top of the space, leaving an empty middle area for content. Funky edge cases, but a useful component

JXFontChooser

Fred has one of these, way cool, we should beg to see if we can get it too smile

JXRichEditorPane?

Combines a JTextPane?/JXEditorPane (or some such) with a toolbar and basic built in functionality. Drop one on a form and it has all the bold/italic/center/left/right/etc functionality with a toolbar ready to go (with a JXFontChooser!!)

JXGradientPicker?

Josh Marinacci has coded one up, need to get it out there. This is an awesome gradient chooser component. Requires new API for handling gradients (some talk of getting this into Dolphin, currently code from Batik). The basic API is quite simple (150 lines or so), but the implementation is rather large (1/2 meg!), so the implementation jar has been separated out as an optional download, only required if multi stop gradient/radial gradient support is required.

VisualWorker?

Like the C# BackgroundWorker?, this would bring SwingWorker? to the visual builder world. Basically, rather than being a class that is extended and overridden, this is a class that is composed of event handlers acting as "callback" methods. It produces more ... spaghetti code, IMO, but a better visual builder experience. A necessary evil, as it were. Maybe we could improve on the concept, though.

AbstractFormatter?/AbstractFormatterFactory implementations

A set of long-missing implementations of AbstractFormatter? and AbstractFormatterFactory? for handling common datatypes with JFormattedTextField?. These would include:
  • Currency
  • Regex
  • Number
  • Email
  • URL
  • Percent
  • Date
  • Time
  • Scientific
  • Fraction
  • Phone Number
  • Zip Code
  • IP Addresses, network masks
  • ForbiddenChars? (makes it easy to define a set of forbidden chars, rather than defining the appropriate regex)
  • Alpha/AlphaNumeric (same as ForbiddenChars? -- simplifies the process)

Vertical Orientation for JLabel

Like http://jroller.com/page/henribenoit?entry=vertical_labels

SpellChecking? on All UI Components

Hook into the native dictionary for all spellchecking needs!

JXShape, JXEllipse, JXRectangle, JXLine, etc

Create a JXPanel derivitive for each of the Java2D? drawing primitives. So, JXEllipse extends JXArea which extends JXShape which extends JXPanel, etc. Map to the Shape, Area, Ellipse, etc primitives. Each should have a setRenderingHints method (ideally this would be available on JComponent, but should really be on JXPanel at least), setStroke, setPaint, etc matching the operations available on a Graphics2D? object. The paintComponent method for each of these panels would then simply execute the correct Graphics2D? calls and draw the appropriate shape.

These are interesting and fun in their own right, but when combined with timingframework and animated transitions it could create some really intersting applications...

Enhanced mnemonic support in JButton, JLabel (others?)

For example: JXButton button = new JXButton("Save &As"); should cause the proper mnemonic to be set (VK_A, position 5). Microsoft has traditionally used the & as the indicator of the mnemonic (such as "Save &As"), but in Avalon they appear to use _ which makes more since (like "Save As"). We could be overly configurable and have a "setMnemonicChar(char c)" method that indicates what the mnemonic char code is ( or & or whatever) but I'm against this. If the text is specified in a resource file, then you won't know what the char code is in the swing file, and it just makes things messy. This is, also, a backwards incompatible change unless we have a "setComputeMnemonic(boolean)" method that will toggle whether to attempt to compute the mnemonic. This again is hacky because the developer making the API call doesn't know what is in the resource file, and so doesn't know whether "_" or "&" will collide with what the localization experts have put in the file.

In reality, however, that's a risk I'm willing to make. It won't cause that many problems, and will make many more developers lives easier.

JXSplitButton?/JXMenuButton

We've seen these crop up on the web in the past, and there are equivilent components in Winforms. I consider this one of the basic missing components. Especially in Microsoft Vista, where Menus seem to have disappeared entirely in favor of menu buttons and popup menus. We're going to want to make this behavior available. Tim B. has one from netbeans/contrib. Need to look into this!

JXToolBar?

Extends JToolBar? so that if the bar is too short for the buttons on it, some scrolling indicator will exist on the toolbar to allow the user to see all the buttons (or perhaps a button at the end that will drop down a menu with the hidden actions).

There should also be some logic for allowing the toolbar to be configured by the user, including hiding or showing different buttons, etc.

JXImgTextField?

A text field which allows embedding an image inside the text field, like in the iTunes search toolbar, where the magnifying glass is inside the search field. I've seen no easy APIs for this. Other uses might be drawing some error icon upon a validation error. Maybe coupling some sort of highlight to the textfield (say when the focus moves to it, or when there's a validation error) can also be included.

JXMultiSlider?

A slider allowing to select a range rather than a value, with two thumbs.

JXPreferencesDialog?

The basic design NetBeans and FireFox? use are good

JXPropertiesSheet?

Cool, and Fred already has a great one :). Josh has also been working on one with an API I really dig.

JXHeader

We talked about this quite a bit, Romain has a good starting point (plus, it looks really good). Probably have Title and description area, where the Title is a JLabel and the description is a JXEditorPane? or something. -- DONE

JXVerticalTabbedPane?

On the lines of JXVerticalLabel?, a JTabbedPane? which does not look strange (with flags sticking out of a panel unsupported) when in the EAST or WEST orientation.

JXFrame.setLookAndFeel

Ok, this one is a HUGE stretch and probably controversial, but what about having a setLookAndFeel method on JXFrame? The idea is that new developers struggle with getting Swing applications to look native, because they have to make some obscure call (UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()). We could make this easier by putting the call on the JXFrame. It feels "hacky", but might be one of those compromises for useability.

JXTaskBar? and JXWindowsMenu?: Enhancements for users of JDesktopPane?

For those apps using JDesktopPane?, these two components can greatly improve its usability, particularly if your users are used to the Windows taskbar. See the tutorial with download. Rbair: Cool!

Total Row for JXTable

A recurring request: having a total row for the JXTable. Internally this could be achieved by mixing two JXTables together: 1 for the main section, 1 for the total row section. This hack has been proposed and used for other JXTable features as well (such as a non-scrolling primary column, etc). Maybe it would be of interest to explore a component that composes multiple JTables and keeps them in sync (when scrolling rows, moving columns, etc). Perhaps that would allow devs to achieve really custom configurations in a flexible way.

Support for large menus

The simple idea is to have "up"/"down" arrows on the menu if there are too many menu items. Another idea was to do a "fisheye" sort of menu. Another was to do "pie menus". Now that is wacky! smile

Detect the user is idle

An interesting use case that showed up on the swing forums recently. The developer wanted to detect when the user was being idle: the mouse and keyboard weren't being used. Having some simple component or feature to turn listening on for this kind of information would be interesting.

JOptionPane? replacement/enhancement

JOptionPane? has a few issues:
  • The API is dense
  • The message text doesn't wrap, so long messages look horrible. This is partly due to a spec problem: the JOptionPane? javadoc specs that a JLabel is used for both the icon and the message text. Instead, this should not be spec'd and the JOptionPane? UI delegates should do a better job of formatting the text, similar to how JXErrorPane? does it. In fact, JXErrorPane? is layed out exactly like JXOptionPane? should be, except for the "details" option.
  • It looks really bad. On OS X it doesn't yield anything even close to the standard OS X error dialog. One reason could be that the JOptionPane? is too general purpose.

JFileCopyPane?/JFileDeletePane/JFileMovePane

Having some prebuilt components that handle moving, deleting, and copying files would be nice. Generally this is a specific dialog look and feel on different plaforms, and it would be nice for Swing applications to look/feel like their native counterparts in this case.

OS X Widgets

Various widget/painter ideas here: http://mattgemmell.com/source need to be explored for SwingX?.

JFileChooser? replacement

There is no good file chooser option under Java6, Windows XP. File Dialog uses the Win2k L&F instead of Win2k one and JFileChooser? has the following highly visible flaws:
  • There is no auto complete while typing paths.
  • Hitting ENTER while a directory is selected closes the dialog, as opposed to drilling down into the directory as the native dialog does.
  • There are other minor visual and keyboard navigation mismatches when compared to the native dialog.

Topic SwingLabsWackyWiki . { Edit | Ref-By | Printable | Diffs r22 < r21 < r20 < r19 < r18 | More }
 XML java.net RSS

Revision r22 - 23 Nov 2006 - 01:23:53 - Main.cowwoc
Parents: WebHome > SwingLabs