Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Problem with FormLayout
Problem with FormLayout [message #461145] Sat, 17 September 2005 00:58 Go to next message
Frank J. Cauley is currently offline Frank J. CauleyFriend
Messages: 4
Registered: July 2009
Junior Member
I copied the code below from an Eclipse site:

Display display = new Display ();
Shell shell = new Shell(display);
FormLayout layout = new FormLayout();
layout.marginWidth = 3;
layout.marginHeight = 3;
shell.setLayout(layout);

marginWidth is underlined with an error
Syntax error on token "marginWidth", VariableDeclaratorId expected after
this token

marginHeight is underlined as an error
Syntax error on token "marginHeight", VariableDeclaratorId expected after
this token

and the period after shell in shel.layout(layout) is underlined as an error
Syntax error on token(s), misplaced construct(s)

The word layout in the parenthesis is also flagged as an error
Syntax error on token "layout", VariableDeclaratorId expected after this
token
Re: Problem with FormLayout [message #461183 is a reply to message #461145] Mon, 19 September 2005 12:33 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Is your project a plugin project (that depends on org.eclipse.ui or
org.eclipse.swt)? Or is it a java project (that has the SWT jars in the
build path)?

I cut and paste your code into an empty class and it was fine:

--------
package org.eclipse.ui.tests;

import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class RunAway {
public static void main(String[] args) {
Display display = new Display ();
Shell shell = new Shell(display);
FormLayout layout = new FormLayout();
layout.marginWidth = 3;
layout.marginHeight = 3;
shell.setLayout(layout);
}
}
--------

Later,
PW


Previous Topic:Showing a TreeNode is Always Expandable
Next Topic:Events on button with Radio property
Goto Forum:
  


Current Time: Fri Apr 26 23:39:55 GMT 2024

Powered by FUDForum. Page generated in 0.11783 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top