Skip to main content

Is there any way to combine Swing and Stage components?

3 replies [Last post]
riepi
Offline
Joined: 2008-03-27

I want to build an application with javafx.application.Frame and javafx.application.Stage. But there is also the need of some inputfields for example. How can i realize this?

or the other way, how to use a stage in Swing Components?

What functionaliy has the attribute canvasStage in javafx.application.Window?

riepi

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
paulbakker
Offline
Joined: 2007-05-11

All components in the swing.ext package will be merged into the Node hierarchy later on however right?

indy
Offline
Joined: 2003-06-10

Hello,

> I want to build an application with
> javafx.application.Frame and
> javafx.application.Stage. But there is also the need
> of some inputfields for example. How can i realize
> this?

At the moment ComponentView{} allows to embed Swing GUI Components in Stage.content.

import javafx.application.*;
import javafx.scene.geometry.*;
import javafx.scene.layout.*;
import javafx.scene.paint.*;
import javafx.ext.swing.*;

Frame{
closeAction: function(): Void {java.lang.System.exit(0);}

title : 'Stage: ComponentView'
width : 300
height : 190
visible : true

stage: Stage{
fill : Color.WHITE
content: VBox{spacing: 4
content: [Rectangle{width: 50 height: 50 fill: Color.BLUE},

ComponentView{component: Button{text: 'ComponentView'}},

ComponentView{component:
FlowPanel{content: [
Button{text: 'Button 1'},
Button{text: 'Button 2'},
Button{text: 'Button 3'}
]}// FlowPanel
}// ComponentView
]}// VBox
}// Stage
}// Frame

tschuess
[|8:)

riepi
Offline
Joined: 2008-03-27

thx, danke ;)