ViewerFromScratch and NetBeans forms

Have jReality programming problems or questions? Post them here.
Post Reply
gmseed
Posts: 3
Joined: Wed 3. Aug 2011, 20:14

ViewerFromScratch and NetBeans forms

Post by gmseed » Sun 7. Aug 2011, 12:52

Hi

I can get the ViewerFromScratch tutorial working at:

http://www3.math.tu-berlin.de/jreality/ ... one_viewer

However, when using an IDE such as NetBeans ui forms are typically used.

If I setup a basic JFrame form with the default FreeDesign ui layout selected and look at the code we have:

public class ViewerFromScratch extends javax.swing.JFrame {

/** Creates new form ViewerFromScratch */
public ViewerFromScratch() {
initComponents();
}
//...

with initComponents() auto-generated by GUIBuilder.

When the application is run the icosahedron is not displayed.

I tracked the problem down to the GUIBuilder applying the default GroupLayout.

If I select a different layout such as BoxLayout:

getContentPane().setLayout(new javax.swing.BoxLayout(getContentPane(), javax.swing.BoxLayout.LINE_AXIS));

then it works. However, careful selection of the layout is required.

Has anyone else experienced this problem and why does it work for BoxLayout and not for other layouts when using ui forms?

Thanks

Graham

Andre
Posts: 226
Joined: Fri 18. Sep 2009, 11:30

Re: ViewerFromScratch and NetBeans forms

Post by Andre » Fri 19. Aug 2011, 21:16

This sounds ugly, did you have any other tutorials where happend the same or was it just the viewerFromScratch-example. What Layout was the installed one, was it the GridBag-Layout what we're using a lot for our GUI. Have tried other Layouts like the Flowlayout aswell?

Post Reply