Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Groovy
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Groovy
displaying an image in a groovy gui
Dan Maples
Ranch Hand
Posts: 153
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
hi everybody, I have a groovy gui that I would like to display an image in, but I have no idea how. Does anybody know how to do this??? This is what I have so far:
import groovy.swing.SwingBuilder; import java.awt.FlowLayout; swing = new SwingBuilder(); gui = swing.frame(title:"Dan's Gui", size:[400,200],defaultCloseOperation:javax.swing.WindowConstants.EXIT_ON_CLOSE) { panel(){ myLabel = label(text:"") } panel(layout: new FlowLayout()){ next = button(text: 'next',actionPerformed:{myLabel.setText("bye")}) previous = button(text: 'previous',actionPerformed:{myLabel.setText("hello")}) //insert something to display an image here } } gui.show();
-Dan
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
controlling size of part of split pane and another error
help please?
Errors in GUI program
Swing GUI Interface Question
Click a button to display an image. Trouble with add panel to a frame. Help !!
More...