tcf{tc}

Solutions for modern developers

Manipulation of objects at the Model Layer in Java Swing before Data is put it the Model

In this article, I will show how to use Java Swing data models for components that accept user input, to automatically manipulate it before it is put in the model. In particular, I will cover the limitation of its input to predefined subsets of characters, memory management for large data sets, and filtering of the input data. All of the principles are based on the object inheritance and can be applied to any component that follows the MVC paradigm.

Read the rest of this entry »

Dynamic error message construction with Java Swing and Regex validation

Any type of Graphical User Interface (GUI) application, designed based on any functional requirement, will assume user interaction as part of its standard functionality. Therefore, almost all GUIs allow users to enter data and manipulate it. After the information is gathered from the user, it typically needs to be either stored, locally or remotely, or used in the application in real time. But, before doing something with the data, applications usually need to check it for correctness. In this article, I will concentrate on form validation and dynamic creation of notification messages in Java Swing GUI applications. I will also go over a few useful tips for GUI developers such as adding listeners to multiple components and using regular expressions for easy validations.

Read the rest of this entry »

Creating interactive UI with Java Swing MVC architecture - part 2

In the first part of this article, I described fundamentals of how a Model-View-Controller design pattern is embedded within a Swing toolkit. In this article, I’ll show how to create a dynamically adjustable presentation of a corresponding model for a Swing Table UI component. The approach will also rely on inheritance, passing objects by reference, and event/listener mechanisms of the Java language. The final sample code will show a solution to the problem of real-time manipulation of a presentation without altering the model, or requesting data again on every user-invoked event. The technique can easily be adapted to any Swing component.

Read the rest of this entry »

Creating interactive UI with Java Swing MVC architecture - part 1

This article is part one of two. This part describes the underlying implementation of Model-View-Controller in Swing and the second part demonstrates a concrete example of the MVC pattern’s strength by showing how use three fundamental mechanisms in Java to alter data presentation at run time without changing the correlating model.

Read the rest of this entry »

Creating dynamic Swing Views with Reflection by extending MVC

This article presents a unique way to apply Reflection and MVC paradigm to the Java Swing to create dynamic GUI Applications. The article builds a sample project and shows how to extend this concept to the enterprise applications.

Read the rest of this entry »

|