When Java first came out, one of its acknowledged weaknesses was the lack of
an advanced set of GUI components. This was especially evident in the text
controls, which lacked many of the advanced features found in the native text
controls of operating systems such as Windows. With the release of the Java
Foundation Classes (also known as Swing), Java finally had a robust and
sophisticated collection of controls, especially text controls.
With this in mind, this series of articles will show how to build a simple
syntax, with emphasis on text control using Swing's Model View Controller
(MVC) architecture and JTextPane. The control will handle keyword
highlighting by changing the font style to a bold format. It will handle both
single-line ("//") and multiline ("/**/") comments by changing the style
to an italic format and the font color to a user-defined one. Strings ... (more)
Last month we discussed the use of Swing's Document model to create a
syntax-highlighting Document model that we could just plug into JTextPane and
use. This month we'll continue with that and add complete support for
comments, strings and numbers. We'll also cover how easy it is to actually
use the model we've developed, and test things out as we go along.
To start things out let's try and use what we have so far. If we look at the
code below we can see that plugging the Document we've created into a
JTextPane component is quite easy. Defining the keywords is also very easy.
JTex... (more)
This column discusses property editors and how to implement one for Java
-specifically, how to make one work for our CodeDocument class. When last we
talked, we saw how to build a CodeDocument class, but it wasn't something we
could work with in a visual designer like JBuilder, say, or Visual Cafe. In
this column we'll build a special case of the JTextArea component and add
some specialty properties and property editors to support the CodeDocument
class we worked on before. The code listings at the end of the article are
excerpted from the complete code, which you can download fr... (more)
Some more ZBrush sculpting:
From Learning 3D
From Learning 3D
Turntable:
... (more)
Originally I planned to continue with the syntax-highlighting CodeDocument
component, but I decided to switch gears and discuss some neat uses for the
JTable component that comes with Swing (my apologies go out to all those
weeping in the aisles, anxiously awaiting more syntax-highlighting code...oh,
just a second, let's dab the tears away before continuing).
One of the cool features of the JTable component is its ability to be
customized, right down to the individual table cell. This feature, plus
another unspeakably cool feature of Java itself (called reflection, but more
on th... (more)