View RSS Feed

Recent Blogs Posts

  1. Simple Frame Transitions without Complex Code

    by , 03-22-2012 at 08:18 PM
    I've spent the past few days looking up Java window transitions that work with Swing components & containers (JFrame, JPanel, etc.).

    Yes, there are packages such as JavaFX which includes a Timeline & Transition framework. I also came across these:

    Project Kenai — We're More Than Just a Forge

    Filthy Rich Clients (find the Animation jar (org.jdesktop.animation))

    However, I've been impatient lately ...
  2. How to use JTree in Java

    by , 02-29-2012 at 07:14 AM
    JTree is a Swing component that displays hierarchical data in a tree structure. The screen-shot below depicts a tree component:

    Name:  sample tree.png
Views: 7646
Size:  12.3 KB
    Figure: A tree component in Java

    This article will focus on how to implement such a tree component in Java, by walking through basic concepts to develop an interesting sample application.

    Fundamental concepts about Tree component

    • Node: A tree displays data vertically in rows,
    Tags: java, jtree, swing Add / Edit Tags
  3. Swing delegation event model

    by , 01-08-2012 at 01:38 PM
    Registered event listeners are notified for the event received by objects in swing delegation event model. Event receiver is a component in most cases.

    Event Types: ActionEvent, KeyEvent, MouseEvent, WindowEvent etc.
    Event Processors: JButton, JList etc.
    EventListeners: ActionListener, ComponentListener, KeyListener etc.

    Name:  62.JPG
Views: 3084
Size:  15.8 KB

    Swing delegation event model
  4. Swing Action architecture

    by , 01-08-2012 at 01:28 PM
    Shared behavior between different user interfaces components are implemented by “Swing Action Architecture”. Like tool bar buttons and menu items perform same actions. All the components are disabled when an action is disabled.

    Java Code: Swing Action Architecture
    class FileAction extends AbstractAction {
    FileAction(String name) {
    public void actionPerformed(ActionEvent ae){
    //add action logic here
    JMenu fileMenu

    Updated 01-14-2012 at 07:56 PM by Java Swing

    Architecture , Actions
  5. AWT vs. Swing

    by , 01-08-2012 at 01:23 PM
    Swing contains a rich set of components as compared to AWT. They are purely build in Java and has following benefits as compared to AWT.

    • Swing contains extra components like JTree, JTable etc.
    • They can change skin based on current look and feel.
    • They follow the MVC design pattern and are more flexible.
    • Swing provided light weight components.
    • Swing provides double buffering.
    • Swing provides paint debugging.

    Swing has following ...
    Tags: awt, swing Add / Edit Tags
  6. How to use model for your table in Swing application

    by , 12-09-2011 at 10:06 AM
    Swing provides a very flexible widget, it is the JTable. Using the JTable component, you can display tabular data in form of columns and rows, plus allowing the user to edit and save the data if needed.

    Why need to use a model

    The Java Swing architecture separates the view and the model of a UI component. The view is how the component is drawn on the screen and gets changed if the user interacts with the component. The model is how data is structured and organized. The ...

    Updated 12-09-2011 at 04:35 PM by Java Swing

    JTable , Model
  7. Introduction to Standard Widget Toolkit

    by , 11-10-2011 at 07:18 PM (My Java Tips)
    AWT (the Abstract Windowing Toolkit) was the first Java GUI toolkit, introduced with JDK 1.0 as one component of the Sun Microsystems Java standard. The relatively primitive AWT wrapped Java code around native (operating system-supplied) objects to create GUI elements, such as menus, windows and buttons. AWT was a very thin wrapper around native widgets, exposing developers to platform specific code, quirks and bugs that limited how portable and native-looking applications could be across different ...