Questions tagged [swingbuilder]

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.

A slightly old introduction

2008 JavaOne talk

Andres Almiray articles

89 questions
1
vote
1 answer

How to use Groovy SwingBuilder to create a JDesktopPand/JInternalFrame combo?

I am trying to create a Groovy MDI application using SwingBuilder. I've started with the basic SwingBuilder example at http://groovy-lang.org/swing.html and added calls to desktopPane and internalFrame: import groovy.swing.SwingBuilder import…
spierepf
  • 2,774
  • 2
  • 30
  • 52
1
vote
1 answer

scroll around a image in groovy?

IM trying to scroll around a image in groovy but not work IM using this code and appears a image static How I could scroll with this code panel(layout: new BorderLayout()) { scrollPane(size:[100,100], …
mightguy
  • 175
  • 1
  • 8
1
vote
1 answer

Get id from Swing component in Groovy SwingBuilder

Let's say I declare an object using SwingBuilder as follows: swing.button(id:'something') I know I can get the Component back from SwingBuilder by calling: swing."something" But how can I go from an instance of the Component, back to its id as a…
allquixotic
  • 1,481
  • 2
  • 18
  • 37
1
vote
1 answer

How to limit visible rows in a JList in groovy

I'm building a small dialog. I using Groovy from a gradle build script. The dialog consists of a JList, a JTextField and a JButton. The list is populated with names of files. There are many files so I only wanna show 5 files together with a scollbar…
1
vote
3 answers

How to add JComboBox to a specific cell in the JTable

I want to change defaultCellEditor to JComboBox only when a specific cell in a table is selected.
Reddy
  • 1,620
  • 6
  • 26
  • 33
1
vote
0 answers

Swingbuilder constraints

Most of the widgets in SwingBuilder have property called constraints. How this is used in controlling the structure/layout. Are there any other uses of this? Also in the code behind, how the builder will translate the constraints into a logic…
vydeek
  • 11
  • 2
1
vote
1 answer

Java components are invisible when swing app is run as APPLET

Respected all, I am making a Swing-application window in ECLIPSE. When I run the program as 'JAVA-Application' the program functions well. However when I try to run the program as "Java_applet" the components like 'command button', 'textbox' are…
1
vote
0 answers

Groovy Swingbuilder Binding

panel(name:"Reference Name") { label("Select XML field for reference name:", constraints:gbc(gridx:0,gridy:0, anchor:WEST)) comboBox(id:"refNameSelectBox",items:displayNameOptions, constraints:gbc(gridx:0,gridy:1,ipadx:20,…
User001
  • 303
  • 1
  • 3
  • 5
1
vote
1 answer

Groovy swingbuilder events for textField

I have the following Code: textField(id: 'programfilter', actionPerformed: { println("execute some action") }) However, the actionPerformed-closure is only called when the textField has the focus and enter is pressed. What do I have to do so that…
valenterry
  • 757
  • 6
  • 21
1
vote
1 answer

Groovy Bindable default value?

I would like to have a text field whose value always reflects that of a certain field in a given object. I thought Bindable might be the way to do this. However, using the following example: #!/usr/bin/env groovy import…
Миша Кошелев
  • 1,483
  • 1
  • 24
  • 41
1
vote
1 answer

Groovy Swingbuilder: How can i add a scrollpanel to my frame?

I want to add a scrollpane, which contains a textarea, but I don't know how. So I searched the internet and found some examples, but none of them helped me. This is some of my code: frame = sb.frame(title:"BPNM Builder", size:[600,…
1
vote
1 answer

Show a variable from Java thread in UI built with SwingBuilder

java source: class jview implements Runnable{ public void run(){ for(int i=1;i<10;i++){ try { Thread.sleep(1000); System.out.println(i); // XXX show in UI } catch…
jake
  • 669
  • 2
  • 8
  • 14
1
vote
1 answer

SpringLayout with SwingBuilder

I am trying to quickly and easily layout rows and columns of buttons and labels. Having buttons and labels be the same width looks ridiculous, so I have ruled out GridLayout. I may slit my wrists if someone suggests GridBagLayout. SO I was…
Kevin Welker
  • 7,719
  • 1
  • 40
  • 56
1
vote
2 answers

populate a comboBox in Griffon App dynamically

I have 2 comboBoxes in my View of Griffon App (or groovy swingBuilder) country = comboBox(items:country(), selectedItem: bind(target:model, 'country', value:model.country), actionPerformed: controller.getStates) state =…
kulkarni
  • 429
  • 1
  • 6
  • 8
1
vote
1 answer

Handling exceptions in Groovy SwingBuilder.doOutside

(This is Groovy 1.8.9. The problem is fixed in Groovy 2.1.0-rc-1) I am trying to handle exceptions that occur in a SwingBuilder.doOutside{}. I have used Thread.setDefaultUncaughtExceptionHandler(), but it doesn't seem to intercept the uncaught…
Dan Halbert
  • 2,761
  • 3
  • 25
  • 28