Any PF programmers in? can i get a hand?
Hopefully somebody will know what I'm on about....
I'm trying to build a basic (windows) panel with two text entry fields. I'm trying to learn Groovy 1.6.0 and NetBeans is failing to compile this code and i think its to do with the open quotation mark in the two textfield statements, i cant take them out though because they are in the working examples I've been through from the developers website so they must work in the code, if they don't then I don't know what would
Here's my simple code......
import javax.swing.WindowConstants as WC
import groovy.swing.SwingBuilder
def swingB = new SwingBuilder()
def frame = swingB.frame(tittle:'Example01', location:[100,100],size:[800,800],
defaultCloseOperation:WC.EXIT_ON_CLOSE)
{
panel(border:titledBorder(title:'Name'))
{
label(text:'First name:')
textField(text:",columns:20)
label(text:'Last name:')
textField(text:",columns:20)
}
}
swingB.doLater{frame.visible = true}
Does anybody know why that causes an error?
Thanks in advance
Pete
I'm trying to build a basic (windows) panel with two text entry fields. I'm trying to learn Groovy 1.6.0 and NetBeans is failing to compile this code and i think its to do with the open quotation mark in the two textfield statements, i cant take them out though because they are in the working examples I've been through from the developers website so they must work in the code, if they don't then I don't know what would
Here's my simple code......
import javax.swing.WindowConstants as WC
import groovy.swing.SwingBuilder
def swingB = new SwingBuilder()
def frame = swingB.frame(tittle:'Example01', location:[100,100],size:[800,800],
defaultCloseOperation:WC.EXIT_ON_CLOSE)
{
panel(border:titledBorder(title:'Name'))
{
label(text:'First name:')
textField(text:",columns:20)
label(text:'Last name:')
textField(text:",columns:20)
}
}
swingB.doLater{frame.visible = true}
Does anybody know why that causes an error?
Thanks in advance
Pete
Thanks Chris, I did have it in as a single quote but after your post changed it to two inverted comma's ('') and now this comes up
init:
deps-jar:
Trying to override old definition of task http://www.netbeans.org/ns/j2se-project/3:javac
Compiling 2 source files to C:\Documents and Settings\Owner\My Documents\NetBeansProjects\JavaApplication1\build\ classes
The option destdir cannot be set on the contained <javac> element. The option will be ignored
The option srcdir cannot be set on the contained <javac> element. The option will be ignored
The option includes cannot be set on the contained <javac> element. The option will be ignored
The option excludes cannot be set on the contained <javac> element. The option will be ignored
The option deprecation cannot be set on the contained <javac> element. The option will be ignored
The option includeantruntime cannot be set on the contained <javac> element. The option will be ignored
org.codehaus.groovy.control.MultipleCompilationErr orsException: startup failed, Invalid commandline usage for javac.
javac: invalid target release: ${javac.target}
Usage: javac <options> <source files>
use -help for a list of possible options
1 error
C:\Documents and Settings\Owner\My Documents\NetBeansProjects\JavaApplication1\nbproj ect\build-impl.xml:339: The following error occurred while executing this line:
C:\Documents and Settings\Owner\My Documents\NetBeansProjects\JavaApplication1\nbproj ect\groovy-build.xml:16: Compilation Failed
BUILD FAILED (total time: 1 second)
any ideas?
init:
deps-jar:
Trying to override old definition of task http://www.netbeans.org/ns/j2se-project/3:javac
Compiling 2 source files to C:\Documents and Settings\Owner\My Documents\NetBeansProjects\JavaApplication1\build\ classes
The option destdir cannot be set on the contained <javac> element. The option will be ignored
The option srcdir cannot be set on the contained <javac> element. The option will be ignored
The option includes cannot be set on the contained <javac> element. The option will be ignored
The option excludes cannot be set on the contained <javac> element. The option will be ignored
The option deprecation cannot be set on the contained <javac> element. The option will be ignored
The option includeantruntime cannot be set on the contained <javac> element. The option will be ignored
org.codehaus.groovy.control.MultipleCompilationErr orsException: startup failed, Invalid commandline usage for javac.
javac: invalid target release: ${javac.target}
Usage: javac <options> <source files>
use -help for a list of possible options
1 error
C:\Documents and Settings\Owner\My Documents\NetBeansProjects\JavaApplication1\nbproj ect\build-impl.xml:339: The following error occurred while executing this line:
C:\Documents and Settings\Owner\My Documents\NetBeansProjects\JavaApplication1\nbproj ect\groovy-build.xml:16: Compilation Failed
BUILD FAILED (total time: 1 second)
any ideas?
import javax.swing.WindowConstants as WC
import groovy.swing.SwingBuilder
def swingB = new SwingBuilder()
def frame = swingB.frame(>>>tittle<<<:'Example01', location:[100,100],size:[800,800],
defaultCloseOperation:WC.EXIT_ON_CLOSE)
{
panel(border:titledBorder(title:'Name'))
{
label(text:'First name:')
textField(text:",columns:20)
label(text:'Last name:')
textField(text:",columns:20)
}
}
swingB.doLater{frame.visible = true}
shud be fixed, simple spelling mistake... been a while since i have coded though notice i have put three arrows eitherside of it the mistake
import groovy.swing.SwingBuilder
def swingB = new SwingBuilder()
def frame = swingB.frame(>>>tittle<<<:'Example01', location:[100,100],size:[800,800],
defaultCloseOperation:WC.EXIT_ON_CLOSE)
{
panel(border:titledBorder(title:'Name'))
{
label(text:'First name:')
textField(text:",columns:20)
label(text:'Last name:')
textField(text:",columns:20)
}
}
swingB.doLater{frame.visible = true}
shud be fixed, simple spelling mistake... been a while since i have coded though notice i have put three arrows eitherside of it the mistake
Trending Topics
Tried it again and getting this...
init:
deps-jar:
Trying to override old definition of task http://www.netbeans.org/ns/j2se-project/3:javac
Compiling 3 source files to C:\Documents and Settings\Owner\My Documents\NetBeansProjects\JavaApplication1\build\ classes
The option destdir cannot be set on the contained <javac> element. The option will be ignored
The option srcdir cannot be set on the contained <javac> element. The option will be ignored
The option includes cannot be set on the contained <javac> element. The option will be ignored
The option excludes cannot be set on the contained <javac> element. The option will be ignored
The option deprecation cannot be set on the contained <javac> element. The option will be ignored
The option includeantruntime cannot be set on the contained <javac> element. The option will be ignored
org.codehaus.groovy.control.MultipleCompilationErr orsException: startup failed, C:\Documents and Settings\Owner\My Documents\NetBeansProjects\JavaApplication1\src\Gr oovyScript1.groovy: 12: expecting anything but ''\n''; got it anyway @ line 12, column 40.
label(text:",'First name:')
^
1 error
C:\Documents and Settings\Owner\My Documents\NetBeansProjects\JavaApplication1\nbproj ect\build-impl.xml:339: The following error occurred while executing this line:
C:\Documents and Settings\Owner\My Documents\NetBeansProjects\JavaApplication1\nbproj ect\groovy-build.xml:16: Compilation Failed
BUILD FAILED (total time: 0 seconds)
A bit dramatic eh?
init:
deps-jar:
Trying to override old definition of task http://www.netbeans.org/ns/j2se-project/3:javac
Compiling 3 source files to C:\Documents and Settings\Owner\My Documents\NetBeansProjects\JavaApplication1\build\ classes
The option destdir cannot be set on the contained <javac> element. The option will be ignored
The option srcdir cannot be set on the contained <javac> element. The option will be ignored
The option includes cannot be set on the contained <javac> element. The option will be ignored
The option excludes cannot be set on the contained <javac> element. The option will be ignored
The option deprecation cannot be set on the contained <javac> element. The option will be ignored
The option includeantruntime cannot be set on the contained <javac> element. The option will be ignored
org.codehaus.groovy.control.MultipleCompilationErr orsException: startup failed, C:\Documents and Settings\Owner\My Documents\NetBeansProjects\JavaApplication1\src\Gr oovyScript1.groovy: 12: expecting anything but ''\n''; got it anyway @ line 12, column 40.
label(text:",'First name:')
^
1 error
C:\Documents and Settings\Owner\My Documents\NetBeansProjects\JavaApplication1\nbproj ect\build-impl.xml:339: The following error occurred while executing this line:
C:\Documents and Settings\Owner\My Documents\NetBeansProjects\JavaApplication1\nbproj ect\groovy-build.xml:16: Compilation Failed
BUILD FAILED (total time: 0 seconds)
A bit dramatic eh?
Hopefully somebody will know what I'm on about....
I'm trying to build a basic (windows) panel with two text entry fields. I'm trying to learn Groovy 1.6.0 and NetBeans is failing to compile this code and i think its to do with the open quotation mark in the two textfield statements, i cant take them out though because they are in the working examples I've been through from the developers website so they must work in the code, if they don't then I don't know what would
Here's my simple code......
import javax.swing.WindowConstants as WC
import groovy.swing.SwingBuilder
def swingB = new SwingBuilder()
def frame = swingB.frame(tittle:'Example01', location:[100,100],size:[800,800],
defaultCloseOperation:WC.EXIT_ON_CLOSE)
{
panel(border:titledBorder(title:'Name'))
{
label(text:'First name:')
textField(text:",columns:20)
label(text:'Last name:')
textField(text:",columns:20)
}
}
swingB.doLater{frame.visible = true}
Does anybody know why that causes an error?
Thanks in advance
Pete
I'm trying to build a basic (windows) panel with two text entry fields. I'm trying to learn Groovy 1.6.0 and NetBeans is failing to compile this code and i think its to do with the open quotation mark in the two textfield statements, i cant take them out though because they are in the working examples I've been through from the developers website so they must work in the code, if they don't then I don't know what would
Here's my simple code......
import javax.swing.WindowConstants as WC
import groovy.swing.SwingBuilder
def swingB = new SwingBuilder()
def frame = swingB.frame(tittle:'Example01', location:[100,100],size:[800,800],
defaultCloseOperation:WC.EXIT_ON_CLOSE)
{
panel(border:titledBorder(title:'Name'))
{
label(text:'First name:')
textField(text:",columns:20)
label(text:'Last name:')
textField(text:",columns:20)
}
}
swingB.doLater{frame.visible = true}
Does anybody know why that causes an error?
Thanks in advance
Pete
got bored so had a little play (its been 2 years since ive touched any code so it may be rough and not what your after)
but this should do exactly what your after i reckon.... let me know?
import groovy.swing.SwingBuilder
import javax.swing.WindowConstants as WC
SwingBuilder.build(){
frame(title:'Example01', location:[100,100], size:[800,800],
visible:true, defaultCloseOperation:WC.EXIT_ON_CLOSE){
gridLayout(cols: 2, rows:0)
label 'First name:'
input = textfield(columns:20, actionPerformed: {
output.text = input.text })
label = 'Last name:'
input = textfield(columns:20, actionPerformed: {
output.text = input.text })
}
}
but this should do exactly what your after i reckon.... let me know?
import groovy.swing.SwingBuilder
import javax.swing.WindowConstants as WC
SwingBuilder.build(){
frame(title:'Example01', location:[100,100], size:[800,800],
visible:true, defaultCloseOperation:WC.EXIT_ON_CLOSE){
gridLayout(cols: 2, rows:0)
label 'First name:'
input = textfield(columns:20, actionPerformed: {
output.text = input.text })
label = 'Last name:'
input = textfield(columns:20, actionPerformed: {
output.text = input.text })
}
}
Thread
Thread Starter
Forum
Replies
Last Post
nicodinho
Ford Non RS / XR / ST parts for sale.
6
Oct 7, 2015 12:56 PM
Adam Graham
Restorations, Rebuilds & Projects.
7
Sep 6, 2015 06:04 AM






