About RadioButtons

Swing Designer allows you to quickly create the frames, panels, dialogs, applets and other UI elements that comprise Java Swing applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

About RadioButtons

Postby Baileys » Thu Oct 20, 2005 6:23 am

Hello

I have a problem with radio buttons. It does not display well in the Designer, when the associated text is in the constructor. The text only displays with a radiobutton.SetText.
Baileys
 
Posts: 22
Joined: Thu Oct 20, 2005 6:18 am
Location: Montreal

Re: About RadioButtons

Postby Eric Clayberg » Thu Oct 20, 2005 6:42 am

Baileys wrote:I have a problem with radio buttons. It does not display well in the Designer, when the associated text is in the constructor. The text only displays with a radiobutton.SetText.

Can you provide an example?

I tried the following and it displayed the text just fine:

Code: Select all
final JRadioButton abcRadioButton = new JRadioButton("ABC");
abcRadioButton.setBounds(10, 10, 50, 25);
getContentPane().add(abcRadioButton);
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Postby Baileys » Thu Oct 20, 2005 11:26 am

Hello,

I changed my shortcut for launching Eclipse 3.1 by passing the jdk 1.5 in the command line.

It works fine now.

Thanks
Baileys
 
Posts: 22
Joined: Thu Oct 20, 2005 6:18 am
Location: Montreal

Postby fabax » Sat Nov 12, 2005 1:21 am

Hallo,
I'm in Eclipse and SWTDesigner a total new beginner, and I have the same problem. :oops: . The problem is that I do not check :? what you have done to solve this problem.

So please can you show me the step I have to do to solve this problem ?
fabax
 
Posts: 4
Joined: Sat Nov 12, 2005 12:54 am
Location: Germany

Postby Eric Clayberg » Mon Nov 14, 2005 10:59 am

fabax wrote:I'm in Eclipse and SWTDesigner a total new beginner, and I have the same problem. :oops: . The problem is that I do not check :? what you have done to solve this problem. So please can you show me the step I have to do to solve this problem ?

Please describe i detail exactly what problem you are having and provide a test case.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Postby fabax » Tue Nov 15, 2005 1:53 am

I try SWT-designer by doing your demo example "swing example". But when I'm on the part to create the group ("ButtonGroup") over the two radio-buttons, nothing happens.
No group will be created. ?
fabax
 
Posts: 4
Joined: Sat Nov 12, 2005 12:54 am
Location: Germany

Postby Eric Clayberg » Tue Nov 15, 2005 6:22 am

fabax wrote:I try SWT-designer by doing your demo example "swing example". But when I'm on the part to create the group ("ButtonGroup") over the two radio-buttons, nothing happens.
No group will be created. ?

How are you creating the group?

All you need to do is drop a button group onto one of the buttons. That will create a button group in the component tree. You can then drag that button group onto the other buttons, or drag the buttons onto the group.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Postby fabax » Tue Nov 15, 2005 11:20 pm

Hello Mr. Clayberg,

this is exactly my problem. When I do so (just as you described ) nothing happens :?:

So I thought it could help, when I do the same as Baileys did.

"... Eclipse 3.1 by passing the jdk 1.5 in the command line ..."

but I don't how to do this.


I use following components

WBP 4.2.0 Build 2005.10.29
Eclipse 3.1.1 Build M20050929-0840
Java SE Build 1.5.0_04-b05
fabax
 
Posts: 4
Joined: Sat Nov 12, 2005 12:54 am
Location: Germany

Postby Eric Clayberg » Wed Nov 16, 2005 4:47 am

JDK 1.5 is not required for ButtonGroups to work and the problem you describe is not related to the original problem described in this thread.

What do you mean by "nothing happens"? Are any exceptions recorded to your Eclipse ".log" file?

Can you drop a ButtonGroup on the frame itself in the component tree?
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Postby fabax » Thu Nov 17, 2005 10:02 am

Hello Mister Clayberg,

At the moment I am really a little bit helpless. I followed your advice and checked the ".log" File in Eclipse by deleting this file first and than do this "operation".
first try
1) mark the radiobutton SWT
2) click on ButtonGroup ( the PLUS Mouse Icon is shown )
3) move the mouse to property editor swtRadioButton('SWT")
4) release the mouse ... and ... nothing :shock:

second try
1) mark the ButtonGroup
2) an click direct on the content pane ... the same effect.


**************************************************
look here the corresponding LOG File
**************************************************

!SESSION 2005-11-17 18:40:43.187 -----------------------------------------------
eclipse.buildId=M20050929-0840
java.version=1.5.0_04
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
Command-line arguments: -os win32 -ws win32 -arch x86

!ENTRY org.eclipse.ui 4 4 2005-11-17 19:00:14.484
!MESSAGE Unhandled event loop exception

!ENTRY org.eclipse.ui 4 0 2005-11-17 19:00:14.484
!MESSAGE Widget is disposed
!STACK 0
org.eclipse.swt.SWTException: Widget is disposed
at org.eclipse.swt.SWT.error(SWT.java:2942)
at org.eclipse.swt.SWT.error(SWT.java:2865)
at org.eclipse.swt.SWT.error(SWT.java:2836)
at org.eclipse.swt.widgets.Widget.error(Widget.java:395)
at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:297)
at org.eclipse.swt.widgets.Scrollable.getClientArea(Scrollable.java:151)
at com.swtdesigner.gef.common.property.FlyoutControlComposite$26.run(FlyoutControlComposite.java:284)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3057)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2716)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.block(ModalContext.java:153)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:303)
at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:447)
at org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.run(ProgressMonitorJobsDialog.java:261)
at org.eclipse.ui.internal.ide.IDEWorkbenchAdvisor.disconnectFromWorkspace(IDEWorkbenchAdvisor.java:298)
at org.eclipse.ui.internal.ide.IDEWorkbenchAdvisor.postShutdown(IDEWorkbenchAdvisor.java:200)
at org.eclipse.ui.internal.Workbench.shutdown(Workbench.java:1997)
at org.eclipse.ui.internal.Workbench.busyClose(Workbench.java:596)
at org.eclipse.ui.internal.Workbench.access$8(Workbench.java:522)
at org.eclipse.ui.internal.Workbench$13.run(Workbench.java:713)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
at org.eclipse.ui.internal.Workbench.close(Workbench.java:711)
at org.eclipse.ui.internal.Workbench.close(Workbench.java:686)
at org.eclipse.ui.internal.WorkbenchWindow.busyClose(WorkbenchWindow.java:643)
at org.eclipse.ui.internal.WorkbenchWindow.access$0(WorkbenchWindow.java:627)
at org.eclipse.ui.internal.WorkbenchWindow$2.run(WorkbenchWindow.java:728)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
at org.eclipse.ui.internal.WorkbenchWindow.close(WorkbenchWindow.java:726)
at org.eclipse.jface.window.Window.handleShellCloseEvent(Window.java:727)
at org.eclipse.jface.window.Window$3.shellClosed(Window.java:674)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:159)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:867)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:852)
at org.eclipse.swt.widgets.Decorations.closeWidget(Decorations.java:257)
at org.eclipse.swt.widgets.Decorations.WM_CLOSE(Decorations.java:1649)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:3040)
at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1582)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:3706)
at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:1651)
at org.eclipse.swt.widgets.Shell.callWindowProc(Shell.java:410)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:3123)
at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1582)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:3706)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1656)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2711)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)

!ENTRY org.eclipse.ui 4 4 2005-11-17 19:00:14.500
!MESSAGE Unhandled event loop exception

!ENTRY org.eclipse.ui 4 0 2005-11-17 19:00:14.515
!MESSAGE Widget is disposed
!STACK 0
org.eclipse.swt.SWTException: Widget is disposed
at org.eclipse.swt.SWT.error(SWT.java:2942)
at org.eclipse.swt.SWT.error(SWT.java:2865)
at org.eclipse.swt.SWT.error(SWT.java:2836)
at org.eclipse.swt.widgets.Widget.error(Widget.java:395)
at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:297)
at org.eclipse.swt.widgets.Label.setImage(Label.java:452)
at org.eclipse.jface.dialogs.ProgressMonitorDialog.updateForSetBlocked(ProgressMonitorDialog.java:267)
at org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.updateForSetBlocked(ProgressMonitorJobsDialog.java:242)
at org.eclipse.jface.dialogs.ProgressMonitorDialog$ProgressMonitor.setBlocked(ProgressMonitorDialog.java:247)
at org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog$3.setBlocked(ProgressMonitorJobsDialog.java:437)
at org.eclipse.jface.operation.AccumulatingProgressMonitor$5.run(AccumulatingProgressMonitor.java:248)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3057)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2716)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)

!ENTRY org.eclipse.ui 4 4 2005-11-17 19:00:14.765
!MESSAGE Unhandled event loop exception

!ENTRY org.eclipse.ui 4 0 2005-11-17 19:00:14.765
!MESSAGE Widget is disposed
!STACK 0
org.eclipse.swt.SWTException: Widget is disposed
at org.eclipse.swt.SWT.error(SWT.java:2942)
at org.eclipse.swt.SWT.error(SWT.java:2865)
at org.eclipse.swt.SWT.error(SWT.java:2836)
at org.eclipse.swt.widgets.Widget.error(Widget.java:395)
at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:297)
at org.eclipse.swt.widgets.Label.setImage(Label.java:452)
at org.eclipse.jface.dialogs.ProgressMonitorDialog.updateForClearBlocked(ProgressMonitorDialog.java:256)
at org.eclipse.jface.dialogs.ProgressMonitorDialog$ProgressMonitor.clearBlocked(ProgressMonitorDialog.java:237)
at org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog$3.clearBlocked(ProgressMonitorJobsDialog.java:424)
at org.eclipse.jface.operation.AccumulatingProgressMonitor$4.run(AccumulatingProgressMonitor.java:226)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3057)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2716)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)
fabax
 
Posts: 4
Joined: Sat Nov 12, 2005 12:54 am
Location: Germany

Postby Eric Clayberg » Mon Nov 21, 2005 7:49 pm

fabax wrote:1) mark the radiobutton SWT
2) click on ButtonGroup ( the PLUS Mouse Icon is shown )
3) move the mouse to property editor swtRadioButton('SWT")
4) release the mouse ... and ... nothing

Releasing the mouse button in the property editor isn't going to do anything.

You need to drop the radio button group either onto the radio button itself (either in the design view or the component tree) or you can drop it on the frame itself in the component tree.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to Swing Designer

Who is online

Users browsing this forum: No registered users and 1 guest