Results 1 to 3 of 3
Thread: adding a JFXPanel to a JFrame
- 11-29-2012, 05:37 PM #1
Member
- Join Date
- Mar 2012
- Posts
- 24
- Rep Power
- 0
adding a JFXPanel to a JFrame
i'm not sure if this is the correct forum... maybe i should have posted in the JavaFX forum?
here's some code:
but the JFXPanel doesn't get drawn at all. do i need to use the following kind of code?Java Code:final JFXPanel coolpanel = new JFXPanel(); coolpanel.setLayout(null); Color mycolor4 = new Color(200, 200, 200); Dimension d8 = new Dimension(100, 100); coolpanel.setSize(d8); coolpanel.setLocation(1800, 200); coolpanel.setPreferredSize(d8); coolpanel.getRootPane(); coolpanel.setBackground(mycolor4); coolpanel.setVisible(true); coolpanel.setFocusable(true); coolpanel.validate(); coolpanel.repaint(); frame.add(coolpanel); frame.validate(); frame.repaint();
i am just looking for a swing-like/basic way of adding a JFXPanel to a JFrame. i'm using netbeans 7.2.1 and JDK 7 update 9.Java Code:public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { initAndShowGUI(); } });
thanks!
- 11-29-2012, 06:08 PM #2
Re: adding a JFXPanel to a JFrame
Have you gone through the official documentation?
JavaFX for Swing Developers
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 11-29-2012, 06:32 PM #3
Member
- Join Date
- Mar 2012
- Posts
- 24
- Rep Power
- 0
Re: adding a JFXPanel to a JFrame
i had a brief look at the official documentation yesterday. i find these types of documentation difficult to understand at times... i'm usually not too good with the oracle documentation. i prefer "actual" code instead.
can you recommend a JavaFX book to me? unfortunately, the "JavaFX for dummies" isn't due to be published for another year!
is swing the way to go here? or should i switch to JavaFX?
thanks again!
Similar Threads
-
adding keylistener to JFrame
By Alkor in forum New To JavaReplies: 3Last Post: 03-08-2012, 12:02 PM -
Adding Swing JFrame form to an applet
By diamonddragon in forum Java AppletsReplies: 2Last Post: 02-06-2012, 06:18 AM -
Adding JButton to JFrame with background
By bzknight in forum AWT / SwingReplies: 1Last Post: 01-19-2011, 06:55 PM -
Adding a KeyListener to a JFrame with buttons.
By jamhead in forum AWT / SwingReplies: 1Last Post: 12-11-2010, 07:29 PM -
[SOLVED] Adding JLabel to JFrame
By mlfatty in forum AWT / SwingReplies: 3Last Post: 03-04-2009, 11:33 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks