Skip navigation.

BlogtimeException

By Behrang Saeedzadeh (the 5th incarnation)

Java Quiz #1

, ,

What will this program print in the console when you run it?

public class Main {
    public static void main(String[] args) {        
        A a = new A();
        B b = null;
        try {            
            b = new B(a);
        } catch (Exception e) {}
        
        System.out.println(a.b);
        System.out.println(b);
        System.out.println(a.b == b);
    }
}

class A {    
    
    B b;    
    
    void setB(B b) {
        this.b = b;
        System.out.println(this.b);
    }    
    
    public String toString() {
        return b.toString();
    }
}

class B {    
    public B(A a) {
        a.setB(this);
        throw new RuntimeException();
    }
    
    public String toString() {
        return "B";
    }    
}

MacBeans, Part II

, , , ...

MacBeans is alive and moving on slowly but steady. There are so many things in NetBeans that can be tweaked to improve its look and feel on OS X Leopard. When I started MacBeans I was directly working on NetBeans' source code but now instead I am creating a plugin module that can be installed on-demand.

At the moment I am working on the EditorTabDisplayerUI. In OS X there is not a standard tabbed pane GUI for holding textual/editable documents. XCode also does not have a tabbed editor. So I initially decided to render EditorTabDisplayerUI's tabs like Safari. However it turned out to be too dark for NetBeans. So I searched and looked for other alternatives. In the end I decided to render it like Camino.
Safari

Camino

This is how CaminoEditorTabDisplayerUI render the EditorTabDisplayer:



MacBeans

Another style for tabbed editors I liked was the one used in Panic's Coda and I am gonna add a Coda-like EditorTabDisplayerUI to MacBeans as well:
Panic's Coda

Another wart of NetBeans' default LAF for OS X is its toolbar bumps (grips). It is not as smooth as it has to be and looks pixelized. However the way the bump is rendered is kind of hard coded and is not customizable. I think I should be able to work around this using Javassist however it is a very dirty trick and it may not even work.
NetBeans Bump

Safari Bump

Also a Google Code project is created for MacBeans and it is accessible at http://code.google.com/p/macbeans/. Right now the project is in trial-and-error exploratory mode so unless you are a big fan of a bowl of fresh spaghetti code you are advised not to look at the source code for the time being :whistle:. Currently the plugin is only tested against NetBeans 6.1.

Last but not the least I would appreciate your feedback. Especially I would like to know which part of NetBeans you think needs to be tweaked to look more native on OS X and how MacBeans can be tweaked further to make it even look better on Leopard.

Visual Basic Nightmare

, , ,

This made me ROFL:

VB Nightmare

Via Geek Hero Web Comic