NetBeans 6 delivers great updates to the Matisse GUI builder. Spend a few minutes with Roman Strobl and get an expert briefing on what's new and what has changed. (sponsored)
In this, the third and final installation of Andres' Introduction to Groovy series, you learn about how Groovy handles variable numbers of arguments, named parameters, currying, and more about Groovy operators. Including, some new operators.
Swing Fuse (actually just Fuse), is a framework designed to make it easier to create your own custom desktop components. In this article, Daniel Spiewak shows you how to get started and provides sample source code you can download.
Willam Louth shows how he uses JXInsight Probes to investigate probable performance issues with code bases that he is not familiar with. He also highlights possible pitfalls in creating a benchmark, as well as in the analysis of results.
MigLayout is a Layout Manager for Swing and SWT created to replace all current layout managers and introduces a very easy to understand yet powerful syntax that resembles CSS.
This is the second posting in a series that will introduce MigLayout and show how easy it is to use.
If you want to start using MigLayout, just head over to
miglayout.com
and everything will be there waiting for you, including more examples.
Miglayout is 100% free and Open Source (BSD)
.
Docking Components, way Beyond BorderLayout
Docking components and panels is a very powerful a easy to understand way to organize a GUI. In Swing you would normally use BorderLayout, however it is very limited since you can only have one panel per side and the overlapping between sides is predetermined and not configurable. MigLayout use simple docking keywords to dock components and panels. The docking component "cuts off" that part of the GUI leaving the rest of the space for the the upcoming components. This is even as flexible as BoxLayout!
The code below produces the panels in the screen shot.
So in this case, spanning (or overlapping) is defined by the order in which you add the components, right? In your example, the north components span over the east component, but not west. If I added the east component before the north components, the north components would not span over west nor east, right?
GUI Layouts for Swing and SWT: Part 2
At 9:43 AM on Sep 14, 2007, Mikael Grev
wrote:
Fresh Jobs for Developers Post a job opportunity
This is the second posting in a series that will introduce MigLayout and show how easy it is to use.
If you want to start using MigLayout, just head over to miglayout.com and everything will be there waiting for you, including more examples. Miglayout is 100% free and Open Source (BSD) .
Docking Components, way Beyond BorderLayout
Docking components and panels is a very powerful a easy to understand way to organize a GUI. In Swing you would normally use BorderLayout, however it is very limited since you can only have one panel per side and the overlapping between sides is predetermined and not configurable. MigLayout use simple docking keywords to dock components and panels. The docking component "cuts off" that part of the GUI leaving the rest of the space for the the upcoming components. This is even as flexible as BoxLayout!The code below produces the panels in the screen shot.
JPanel panel = new JPanel(new MigLayout()); panel.add(createLabel("West Panel"), "dock west"); panel.add(createLabel("North 1 Panel"), "dock north"); panel.add(createLabel("North 2 Panel"), "dock north"); panel.add(createLabel("South Panel"), "dock south"); panel.add(createLabel("East Panel"), "dock east"); panel.add(createLabel("Center Panel"), "grow, push"); // "dock center" from v3.0 return panel;Screen Shot
The code for creating the panel is not relevant to this example however for completeness I poste it here:
private static JLabel createLabel(String text) { JLabel label = new JLabel(text); label.setHorizontalAlignment(JLabel.CENTER); label.setBorder(new CompoundBorder(new EtchedBorder(), new EmptyBorder(5, 10, 5, 10))); return label; }Cheers,
Mikael Grev
2 replies so far (
Post your own)
Re: GUI Layouts for Swing and SWT: Part 2
So in this case, spanning (or overlapping) is defined by the order in which you add the components, right? In your example, the north components span over the east component, but not west. If I added the east component before the north components, the north components would not span over west nor east, right?Romain Guy's Java Weblog, #ProgX, Jext
Re: GUI Layouts for Swing and SWT: Part 2
Hello Romain,Yes, you are correct. Insertion order matters.
Cheers,
MiG Java Calendar Component, MiG Layout for Swing/SWT (Vote -> JDK)