General Car Related Discussion. To discuss anything that is related to cars and automotive technology that doesnt naturally fit into another forum catagory.
Sponsored by:
Sponsored by:

Any PF programmers in? can i get a hand?

Thread Tools
 
Search this Thread
 
Old 26-02-2009, 12:45 PM
  #1  
PeterD
PassionFord Post Whore!!
Thread Starter
 
PeterD's Avatar
 
Join Date: Nov 2005
Location: Edinburgh
Posts: 4,062
Likes: 0
Received 0 Likes on 0 Posts
Default 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
Old 26-02-2009, 12:49 PM
  #2  
cjwood555
Advanced PassionFord User
 
cjwood555's Avatar
 
Join Date: Feb 2005
Location: Solihull
Posts: 2,090
Likes: 0
Received 0 Likes on 0 Posts
Default

have you put the quotations in as one quotation or two inverted commas? should be the latter.

Chris
Old 26-02-2009, 12:59 PM
  #3  
PeterD
PassionFord Post Whore!!
Thread Starter
 
PeterD's Avatar
 
Join Date: Nov 2005
Location: Edinburgh
Posts: 4,062
Likes: 0
Received 0 Likes on 0 Posts
Default

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?
Old 26-02-2009, 05:18 PM
  #4  
cjwood555
Advanced PassionFord User
 
cjwood555's Avatar
 
Join Date: Feb 2005
Location: Solihull
Posts: 2,090
Likes: 0
Received 0 Likes on 0 Posts
Default

not familiar with net beans etc - would suggest trying creating a new project from scratch and copy/paste your code into it.
Old 26-02-2009, 05:21 PM
  #5  
PeterD
PassionFord Post Whore!!
Thread Starter
 
PeterD's Avatar
 
Join Date: Nov 2005
Location: Edinburgh
Posts: 4,062
Likes: 0
Received 0 Likes on 0 Posts
Default

Cheers mate i'll have another go over the weekend, got pissed off with it and worked on some c++ instead

pete
Old 26-02-2009, 06:12 PM
  #6  
boy_in_blue_x
Wahay!! I've lost my Virginity!!
 
boy_in_blue_x's Avatar
 
Join Date: Sep 2007
Location: Kent
Posts: 95
Likes: 0
Received 0 Likes on 0 Posts
Default

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
Old 26-02-2009, 06:17 PM
  #7  
PeterD
PassionFord Post Whore!!
Thread Starter
 
PeterD's Avatar
 
Join Date: Nov 2005
Location: Edinburgh
Posts: 4,062
Likes: 0
Received 0 Likes on 0 Posts
Default

OH!

Well spotted mate!

I'll have a go at it when I'm back in again tomorrow and let you know.

Pete
Old 26-02-2009, 06:22 PM
  #8  
boy_in_blue_x
Wahay!! I've lost my Virginity!!
 
boy_in_blue_x's Avatar
 
Join Date: Sep 2007
Location: Kent
Posts: 95
Likes: 0
Received 0 Likes on 0 Posts
Default

forgot to add that you might be missing some "{ }" to begin the process then end it as you have a single commmand line outside of any brackets
Old 26-02-2009, 06:23 PM
  #9  
boy_in_blue_x
Wahay!! I've lost my Virginity!!
 
boy_in_blue_x's Avatar
 
Join Date: Sep 2007
Location: Kent
Posts: 95
Likes: 0
Received 0 Likes on 0 Posts
Default

if i still had all the programs installed i would spend more time working out what's wrong but im afraid i dont.... plenty of help on google if you have a look though
Old 26-02-2009, 06:52 PM
  #10  
PeterD
PassionFord Post Whore!!
Thread Starter
 
PeterD's Avatar
 
Join Date: Nov 2005
Location: Edinburgh
Posts: 4,062
Likes: 0
Received 0 Likes on 0 Posts
Default

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?
Old 26-02-2009, 07:20 PM
  #11  
Roscco
Livin' [H]ard & Fast
 
Roscco's Avatar
 
Join Date: Feb 2008
Location: Edinburgh
Posts: 564
Likes: 0
Received 0 Likes on 0 Posts
Default

Originally Posted by PeterD
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
The javax bit that i've made bold in the quote, should that not be javac ? All your output errors are asking for that eg "cannot be set on the contained <javac> element."
Old 28-02-2009, 02:54 AM
  #12  
boy_in_blue_x
Wahay!! I've lost my Virginity!!
 
boy_in_blue_x's Avatar
 
Join Date: Sep 2007
Location: Kent
Posts: 95
Likes: 0
Received 0 Likes on 0 Posts
Default

can you link me to the site your learning from.... might get back into solving this sort of stuff... working on summink now but i have no compilers to check it
Old 28-02-2009, 03:11 AM
  #13  
boy_in_blue_x
Wahay!! I've lost my Virginity!!
 
boy_in_blue_x's Avatar
 
Join Date: Sep 2007
Location: Kent
Posts: 95
Likes: 0
Received 0 Likes on 0 Posts
Default

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 })
}
}
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
STeve
Official Passionford Show Attendances
9
26-06-2017 06:18 PM
nicodinho
Ford Non RS / XR / ST parts for sale.
6
07-10-2015 12:56 PM
locum8
Technical help Q & A
5
01-10-2015 01:50 PM
Adam Graham
Restorations, Rebuilds & Projects.
7
06-09-2015 06:04 AM
hopper350
Garage / Workshop & Tools Section.
2
04-09-2015 12:53 AM



Quick Reply: Any PF programmers in? can i get a hand?



All times are GMT. The time now is 04:34 AM.