swingbuilder

Groovy SwingBuilder : controlling the style of the tabs titles in JTabbedPane

被刻印的时光 ゝ 提交于 2020-01-03 02:48:11
问题 I can't find a way (is there any ?) to format the style of tabs titles in a JTabbedPane. I can change the background color of the tab panes (see below), but can't find a way to style the titles of the tabs; I would like to have them bold or red or be able to define the tabs width, for instance, like I could format the style of the labels in the first panel. Here's the code, mostly inspired by tim_yates (Groovy SwingBuilder : using a scrollpanel to show a list of panels) : import groovy.swing

Gradle SwingBuilder: “Toolkit not found: apple.awt.CToolkit” error

不想你离开。 提交于 2019-12-25 02:58:27
问题 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) Execution failed for task ':XXXXXX:ask'. > Toolkit not found: apple.awt.CToolkit Obviously, I don't have something installed on my Mac but I'm not sure what I need to install. Is this a Java dependency? Or Gradle? (Googling this does not help very

Importing Eclipse-generated GUI forms in to IntelliJ

∥☆過路亽.° 提交于 2019-12-25 02:44:41
问题 I have a Java GUI application (Swing) that I built using Eclipse's designer. Most forms use Group layout, with the layouts/controls stuff written directly in the class constructor. I have downloaded IntelliJ for evaluation, and succesfully imported my eclipse .project files and see them as modules in IntelliJ Is there a way to get IntelliJ to understand this file and use its GUI designer? Right now, my form classes appear just as regular source code files. 回答1: There is no support for what

Groovy SwingBuilder : button to change the color of a panel

一曲冷凌霜 提交于 2019-12-21 21:33:17
问题 Why does this code fail ? I want to change the color of one panel in a series of several panels, dynamically constructed (total number of panels not known beforehand). For some reason, this code works when referencing the name of a particular panel (for example 'panel2'), but not when I refer to it dynamically ('panelID'). import groovy.swing.SwingBuilder import javax.swing.WindowConstants as WC import javax.swing.JOptionPane import javax.swing.BoxLayout as BXL swing = new SwingBuilder()

SwingBuilder like GUI syntax for Java?

…衆ロ難τιáo~ 提交于 2019-12-12 19:13:39
问题 Is there a library that makes it possible to write Swing based GUIs similar to the manner done by SwingBuilder in Groovy? I am hoping to develop a Java GUI application without embedding Groovy or another complete programming language in Java, and I find the standard Java syntax rather tedious. 回答1: I went down this path at one point, then I found MiGLayout - unless I'm using a split pane, I can generally lay out each of my views in a single panel, with a minimum of hassle. There is a tad of a

Groovy SwingBuilder : changing size and/or font of tabs (in jTabbedpane)

蓝咒 提交于 2019-12-12 05:38:09
问题 I can't find any information on how to change the tabs size or the font of the names labels (on color, etc) Regards, Michel 回答1: Here is the link that i guess your looking for Practically Groovy(Part-2). However in this link, you can scroll down to find the heading called " Adding a TabbedPane to Gwitter " Which does the good job of explaining how to create and handle the TabbedPane in Groovy. Let me know if i have answered your question. 来源: https://stackoverflow.com/questions/6481040/groovy

Changing value in textfield with groovy and SwingBuilder

跟風遠走 提交于 2019-12-12 02:27:00
问题 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 = sb.panel(layout: new BorderLayout()) { sb.panel(constraints: BorderLayout.NORTH){ gridLayout(cols: 2, rows: 3) textField id:'tf', text: ? } } 回答1: You can do that with the doOutside method of SwingBuilder, which allows to run a closure outside the EDT. The code below

Groovy SwingBuilder : using a scrollpanel to show a list of panels

瘦欲@ 提交于 2019-12-11 02:04:49
问题 I would like to show a list of panels containing components, i.e a checkbox, labels, buttons, all on the same horizontal line; each panel represents one set of components to display information for one item. I need to put the list of panels (number undetermined) inside a scrollpanel to fit within the main panel height. I can't seem to find a solution for mixing scrollpanel and panels with components. I'd like to get this result : scrollpanel { checkbox | item1 | button1 | button1 | label1 |

Groovy SwingBuilder bind to multiple properties

点点圈 提交于 2019-12-08 05:45:32
问题 Is there a way to bind a properties to multiple properties of another object using the SwingBuilder? For example, I want to bind a button's enabled property to two text fields - the button is only enabled when both text fields are non empty. 回答1: You can do this sort of thing: import groovy.beans.Bindable import groovy.swing.SwingBuilder import javax.swing.WindowConstants as WC class CombinedModel { @Bindable String text1 @Bindable String text2 } def model = new CombinedModel() SwingBuilder

Groovy SwingBuilder bind to multiple properties

落爺英雄遲暮 提交于 2019-12-07 00:21:29
Is there a way to bind a properties to multiple properties of another object using the SwingBuilder? For example, I want to bind a button's enabled property to two text fields - the button is only enabled when both text fields are non empty. You can do this sort of thing: import groovy.beans.Bindable import groovy.swing.SwingBuilder import javax.swing.WindowConstants as WC class CombinedModel { @Bindable String text1 @Bindable String text2 } def model = new CombinedModel() SwingBuilder.build() { frame(title:'Multiple Bind Test', pack:true, visible: true, defaultCloseOperation:WC.EXIT_ON_CLOSE