<< Previous | Home

Stephen Chin: Open Source JavaFX Petition

A few minutes ago, Stephen Chin, leader of the Silicon Valley JavaFX User's Group, lead of the JFXtras open source JavaFX utilities and add-ons project, and a coauthor (with Jim Weaver, Deam Iverson and I) of the Apress book Pro JavaFX Platform, announced at the July 14, 2010 meeting of the SvJUGFX a petition drive to encourage Oracle to open source the entire JavaFX platform:

Stephen Chin:

To the Leaders, Management, and Board of Directors at Oracle Corporation,

We the undersigned formally request that Oracle Corporation release the entire JavaFX Platform as open source software available for modification and reuse by individuals, educators, and corporations.

Open source software has transformed the way that we build and use software. It has increased the educational reach of technology, allowed new and innovative applications to emerge, and spawned the growth of communities dedicated to software philanthropy. Java has been at the forefront of this revolution, providing a platform for open source development, and becoming an open source effort in itself.

JavaFX is an innovative technology built on top of Java that allows the creation of next generation Rich Internet Applications (RIA). We believe that an essential part of the future success of this platform is to release it as open source software. This would increase adoption by companies that fear lock-in or are concerned about technology maturity. It would also make it competitive with other RIA platforms that have embraced the open source model.

We recognize that Oracle Corporation has made a significant investment in JavaFX technology, and continues to grow and extend the platform. We encourage Oracle to continue their investment in the JavaFX platform, including monetization of the platform through training, support, and other professional services. In our estimation, the increased adoption of JavaFX will make the platform even more profitable for Oracle that it currently is as a proprietary technology.

Therefore, we proudly make this request to open source the JavaFX platform in the mutual interest of JavaFX technology and the future success of Oracle Corporation.

I believe open sourcing the entire JavaFX platform is one way to unlock the powerful potential of the platform, drive its adoption in a wider industry segment, and ultimately benefit both Oracle and the JavaFX community.

Tags :

Friday Java Quiz: What Will The GUI Show?


1    import javax.swing.*; 
2    import java.awt.*; 
3    import java.awt.event.*; 
4     
5    public class Foo { 
6        public static void main(final String[] args) { 
7            EventQueue.invokeLater(new Runnable() { 
8                public void run() { 
9                    swingMain(); 
10               } 
11           }); 
12       } 
13    
14       private static void swingMain() { 
15           JFrame frame = new JFrame("Demo"); 
16           frame.setLayout(new FlowLayout()); 
17    
18           JTextField tf1 = new JTextField(20); 
19           final JTextField tf2 = new JTextField(20); 
20           JButton b = new JButton("Click Me"); 
21    
22           tf1.addFocusListener(new FocusAdapter() { 
23               @Override 
24               public void focusLost(FocusEvent e) { 
25                   tf2.setText("Lost Focus!"); 
26               } 
27           }); 
28    
29           b.addActionListener(new ActionListener() { 
30               public void actionPerformed(ActionEvent e) { 
31                   tf2.setText("Clicked!"); 
32               } 
33           }); 
34    
35           frame.add(tf1); 
36           frame.add(tf2); 
37           frame.add(b); 
38           frame.pack(); 
39           frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); 
40           frame.setVisible(true); 
41       } 
42   }

Q: If, after starting the above Swing program, you click on the JButton b, what will the JTextField jt2 show?
Lost Focus!
or
Clicked!

Strict rule apply: no compiling and running, no Googling, and your first answer is the final answer. You are allowed to read the Javadoc of the relevant classes though.

Tags :

Friday Java Quiz: What's The Exit Status

Most of you probably will read this in Saturday morning. However it's still Friday here, so I'll send this out as a Friday Java Quiz.

The Thread.UncaughtExceptionHandler interface in Java 5 allows Java programs to react to Throwables that are not caught and handled by any method on a thread's call stack.

The following class registers a global uncaught exception handler that is invoked when a Throwable bubbles up to the root of any thread stack:

1    public class Main { 
2        public static void main(String[] args) { 
3            Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { 
4                public void run() { 
5                    // Clean up resources: close open files, close databases, etc. 
6                } 
7            })); 
8            Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { 
9                public void uncaughtException(Thread t, Throwable e) { 
10                   if (e instanceof Error) { 
11                       System.exit(99); 
12                   } 
13               } 
14           }); 
15           // The application proper: starting the GUI, listening on ServerSockets, etc. 
16       } 
17   } 
18   

Assume a memory leak in the application causes the JVM to run out of memory and the JVM starts to throw OutOfMemoryError that eventually causes line 11 to be executed and the process is terminated soon afterwards.

Q: What will the exit status of the Java process as seen by the shell be? Is it 99? Can it be anything other than 99?

This is a tricky question. The relaxed rule apply: you can use Google, read books or even compile and run test codes.

Tags :