Swing Builder helps you create Swing GUI in a declarative and concise fashion. Like other Groovy builders, it uses tree based declarative syntax to create objects, handles the busywork of creating complex objects for you, such as instantiating children, calling Swing methods, and attaching these children to their parents.
Questions tagged [swingbuilder]
89 questions
0
votes
1 answer
how I could update groovy image in panel when click a button?
I’m trying to use this code for show an image in panel and then update the image when click but not works (not updating the image)
Getting this error:
Exception in thread "AWT-EventQueue-0" groovy.lang.MissingPropertyException: No such property:…

mightguy
- 175
- 1
- 8
0
votes
1 answer
Is it possible to use Java Lambdas to implement something like Groovy's SwingBuilder?
It just occurred to me that with Lambdas it might be possible to build something like SwingBuilder in native Java--but it seems like if this were possible it would have been done by now.
Is there any reason this couldn't be done, or has it been…

Bill K
- 62,186
- 18
- 105
- 157
0
votes
1 answer
Table using groovy's swing builder
Until now I've developed in PHP and JavaScript. I'm currently learning groovy, but unfortunately there aren't many tutorials about this language and the book, I'm currently reading (Groovy Recipes), doesn't contain anything about using groovy's…

Damian Frizzi
- 3
- 3
0
votes
0 answers
How can I check to see if a valueChanged event of a Swing JList was changed via click or mouse?
Here's some example code, using Groovy's swingbuilder to create the code for the valueChanged event of a JList:
mainList.valueChanged = { event ->
if (event.isAdjusting) {
index = mainList.selectedIndex
…

Ajv2324
- 422
- 8
- 24
0
votes
1 answer
How do you close a frame when using Swingbuilder?
Using groovy's swingbuilder I'd like to add a save and exit button, but I can't figure out how to close a frame with the swingbuilder? Since I don't have the frame assigned to an object I can't really do frame.dispose() or anything like…

Ajv2324
- 422
- 8
- 24
0
votes
1 answer
Is it still possible to create mdi applications using the netbeans gui builder?
I found an example @ http://matthewryan.info/netbeans/5.0/netbeans_mdi.html
But those options aren't present in the most recent version of netbeans. Is there another way to make internal frames using the builder or is it necessary to make the panels…

davidahines
- 3,976
- 16
- 53
- 87
0
votes
0 answers
Lanterna Groovy SwingBuilder
Is there any way I can use lanterna in Groovy using SwingBuilder? Or at least something similar? I like Groovy, and I would like to use it to make a command line app, but it would be nice if it were concise and in Groovy.

perryprog
- 111
- 2
- 13
0
votes
1 answer
Groovy SwingBuilder ToggleButton StateChange
Is there anyway to avoid the stateChange event being fired more than one time when the toggleButton is clicked? Or am I using the wrong event handler? It gets called 5 times for every toggle.
#!/usr/bin/env groovy
import…

TX T
- 817
- 2
- 16
- 25
0
votes
2 answers
Unable to align JLabel component in JPanel to the left of the JPanel it is in
No matter how I set my Bounds for my JLabel, it is always in the same spot. I am using the Window Builder Swing Designer Application window. Here is my code:
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import…

Jane Poe
- 125
- 5
- 16
0
votes
1 answer
Griffon integration test or script that displays a griffon View
When I create plane java Swing components like dialog boxes etc, it is very easy to make a unit test to display the Dialog. Basically, I can just create an instance of the dialog and call setIsVisible(true). I'm having a really tough time figuring…

GNSL
- 101
- 4
0
votes
1 answer
FPL Forum Application
I am trying to create a professional login / registration form and at the minute I have this code that is not working: It is going to be for a FPL Forum I am creating through NetBeans.
Any help on the subject would be much appreciated.
package…

Aaron Boyse
- 3
- 1
- 2
0
votes
1 answer
Gradle SwingBuilder: "Toolkit not found: apple.awt.CToolkit" error
I have a Gradle task that is supposed to prompt if the user wants to continue or not (part of a larger task for my Android app).
I'm using SwingBuilder to to try construct a dialog but I'm getting the following error when I try to build:
Error:(94)…

Jay Sidri
- 6,271
- 3
- 43
- 62
0
votes
0 answers
groovy binding to a map element
Is it possible to bind to a map element ?
mybean = new MyBean()
swing.edt {
dialog() {
vbox(){
label(text: '> Please enter your developer account')
def tf = textField(columns:10)
bean mybean, myMap.myKey: bind {tf.text}
…

facewindu
- 705
- 3
- 11
- 31
0
votes
1 answer
Changing value in textfield with groovy and SwingBuilder
I want to put the value of a variable (==i) in a textfield, so that its value is shown in the textfield, i.e., changing from 1 to 10.
def sb = new SwingBuilder()
def th = Thread.start {
for(i in 1..10) {
sleep 2000
}
}
def Pan =…

jake
- 669
- 2
- 8
- 14
0
votes
1 answer
Column Headers not shown up in JTable
Though I have read all the relevant answers, I am still stuck on the question of how to display the column headers in a JTable. I tried adding JScrollPane but it did not work. Any help please. Below is given the code:
frame = new JFrame();
…