Details
Description
This code works well:
def frame = new JFrame()
frame.setLocationRelativeTo(null)
But this one throws exception:
def frame = new JFrame()
frame.locationRelativeTo = null
But it is possible to use locationRelativeTo in SwingBuilder, like if
it is existing property.
Example:
def swing = new SwingBuilder()
def frame = swing.frame(
title: "Cool Groovy Frame",
defaultCloseOperation: JFrame.EXIT_ON_CLOSE,
preferredSize: [400, 400],
size: [400, 400],
locationRelativeTo: null,
) {
....
}
Issue Links
| This issue is duplicated by: | ||||
| GROOVY-1150 | Strange behavior on property setter |
|
|
|
Danno Ferrin (<danno.ferrin@shemnon.com>) wrote also:
There are at least three write only properties missed on JFrame...
java.beans.Introspector.getBeanInfo(javax.swing.JFrame).propertyDescriptors.collect {it.name} - new javax.swing.JFrame().properties.keySet()
Result: ["component", "focusTraversalKeys", "locationRelativeTo"]