Creating a custom JFrame to swing designer

Swing Designer allows you to quickly create the frames, panels, dialogs, applets and other UI elements that comprise Java Swing applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Creating a custom JFrame to swing designer

Postby aslani » Tue Nov 14, 2006 1:47 am

Is it possible to create my own custom JFrame template to swing designer?

This is done very easy in Netbeans, you just right click on your custom frame and choose "Use as template".


Something else I miss from Netbeans is the ability to center align my frame in the screen with the swing designer. Right now I have to put this code in the end of my frame:

java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
setLocation((screenSize.width - getWidth()) / 2, (screenSize.height - getHeight()) / 2);

It could be greate if this could be done with the swing designer?
aslani
 
Posts: 4
Joined: Fri Sep 22, 2006 1:31 am

Re: Creating a custom JFrame to swing designer

Postby Eric Clayberg » Fri Nov 24, 2006 5:55 am

aslani wrote:Is it possible to create my own custom JFrame template to swing designer?

The standard JFrame template that Designer uses can be found here:

plugins\com.swtdesigner_6.0.1\templates\Swing\JFrame.jvt

It's a pretty simple file format, so you could modify that directly to achieve what you want. If you do that, you would need to update that file every time you installed a new Swing Designer build.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to Swing Designer

Who is online

Users browsing this forum: No registered users and 1 guest