Archives for the 'GUI' Category

A Simple GridBagLayout Example: Forms

GridBagLayout is, at times, a little too flexible. This simple example illustrates the use of GridBagLayout to generate nicely aligned forms for entering data.

30 June 2006 | GUI | No Comments

Batch Text Inserts with JTextPane

Part II of “Faster JTextPane Text Insertion” describes another technique for overcoming some of JTextPane‘s performance limitations when initiatializing large documents with complex styles. The ElementSpec class, defined as part of DefaultStyledDocument, provides a way to batch updates and apply them in bulk. Depending on size and complexity of the document, the speed boost can [...]

4 January 2004 | GUI, Optimization | No Comments

Why are JTextPane inserts so slow?

Inserting a large amount of styled text into a JTextPane can be painfully slow. Part I of “Faster JTextPane Text Insertion” examines two sources of sluggishness and illustrates a simple solution for one of them. (Part II will describe an additional solution.)

2 January 2004 | GUI, Optimization | No Comments

Missing Bold and Italic Fonts on Panther

Users of Microsoft Office on Panther (Mac OSX 10.3) may find that bold and italic fonts no longer work in JDK 1.4 applications. “Java Font Problems under Panther” describes a quick fix.

24 November 2003 | GUI | No Comments

Setting JTextPane Font and Color

Swing’s JTextPane supports styled text, embedded images and components, and other features not available in the AWT TextArea. However, basic operations like setting the font and color for the text are somewhat more complicated with JTextPane than with TextArea and other simpler text components. “Setting JTextPane Font and Color” illustrates the use of character attributes [...]

12 November 2003 | GUI | No Comments

Vanishing Text Selections

In Java 1.3, opening a menu will temporarily hide selections in Swing text components. The glitch is mostly harmless, but can be disconcerting for users who are, for examples, selecting clipboard operations from a menu. “Fixing Disappearing Text Selections when a Menu is Opened” describes a simple fix for the problem.

3 November 2003 | GUI | No Comments


Categories



Pages

Meta


Copyright 2003-2016 - Philip Isenhour - All code samples may be freely used under the MIT Open-Source License