Javafx with jinternalframe

Has anyone use javafx with jinternalframe from swing?
how was it? everyting works? Cuz I m having problems

Javafx programs may contain either:
- multiple stages or
- one stage, multiple scenes or
- one stage, one scene, and multiple groups (or layouts)
Below is an example of the second option.
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.*;
import javafx.stage.Stage;
import javafx.scene.Group;
public class SceneX extends Application {
     * @param args the command line arguments
    public static void main(String[] args) {
        launch(args);
    @Override
    public void start(final Stage primaryStage) {
        final HBox gr1 = new HBox();
        final HBox gr2 = new HBox();
        primaryStage.setTitle("Hello World!");
        Button btn1 = new Button();
        btn1.setText("Go to page 2");
        gr1.getChildren().addAll(new Label("First    "), btn1);
        final Scene sc1 = new Scene(gr1, 300, 250);
        final Scene sc2 = new Scene(gr2, 300, 250);
        btn1.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent event) {
                primaryStage.setScene(sc2);
        Button btn2 = new Button();
        btn2.setText("Go to page 1");
        gr2.getChildren().add(btn2);
        btn2.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent event) {
                primaryStage.setScene(sc1);
        primaryStage.setScene(sc1);
        primaryStage.show();
}

Similar Messages

  • Problem with JInternalFrame

    Hii there,
    I'm having a problem with JInternalFrame, that is, when I'm trying to open multiple frames, it is overlapping one another and sometimes one of them disappears, I did something like this,
    dpane=new JDesktopPane();                                                 
                            dpane.setDesktopManager(new DefaultDesktopManager());
                            dpane.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
                            iframe=new JInternalFrame("Title" ,true,true,true,true);  
                            //iframe.setPreferredSize(new Dimension(1010,800));
                            iframe.setResizable(false);
                            vScrollPane = new JScrollPane(viewPanel,JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                            JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);                       
                            iframe.setPreferredSize(new Dimension(1010,800));
                            iframe.setLocation(0,1);
                            iframe.setVisible(true);
                            iframe.show();
                            iframe.getContentPane().add(vScrollPane,BorderLayout.EAST);                      
                            iframe.getContentPane().add(hScrollBar,BorderLayout.SOUTH);
                            iframe.moveToFront();
                            iframe.setFocusable(true);
                            iframe.pack();
                            dpane.add(iframe);                                      
                            getContentPane().add(dpane);could u someone plz help me !
    Dev

    [How to Use Internal Frames|http://java.sun.com/docs/books/tutorial/uiswing/components/internalframe.html]

  • Want to integrate JavaFX with JSF

    Hi all,
    I am developing a web application in JSF. I want to integrate it with JavaFX. Is it possible to do so? If possible then how can I achieve it?
    Thanks in advance,
    JSF GEEKS

    Actually I found the same code for integrating JavaFX with JSF, which you have linked, but I show it afterwards. Anyways, thanks for your kind support.
    The other interesting thing I found is, interaction between JavaFX and JSF.
    You can interact between JavaFX and JSF like the following way.
    You just give the id in the script in which you have defined the parameters of applet to run in browser with JSF or any language like this;
    <ui:script id="js" type="text/javascript">
        javafx(
                  archive: "Your_JAR_File.jar",
                  draggable: true,
                  width: 550,
                  height: 370,
                  code: "package_name.Main",
                  name: "Name_of_Application/package_name",
    id: "myJavaFX"
        </ui:script>Then uin the header part of your page (acually in <head>), you write another script something like below;
    <script language="javascript" type="text/javascript">
    function changeColor() {
    myJavaFX.script.line1=myJavaFX.Packages.javafx.scene.paint.Color.WHITE;
    myJavaFX.script.line2=myJavaFX.Packages.javafx.scene.paint.Color.LIGHTBLUE;
    </script>Here line1+ & line2 are the variables of JavaFX script/program. So here, by this example I am changing the value of variables of JavaFX script to change the colors. myJavaFX {color:#333333} {color}is the id of the applet which I have given in the first script to generate and run the applet in browser.
    so here I give you what I understood. Hope it helps.
    Thanks,
    JSF GEEKS
    Edited by: jsfgeeks on Sep 17, 2009 10:59 AM
    Edited by: jsfgeeks on Sep 17, 2009 11:02 AM
    Edited by: jsfgeeks on Sep 17, 2009 11:03 AM
    Edited by: jsfgeeks on Sep 17, 2009 11:04 AM

  • JavaFX with external libraries

    Hi,
    I would like to get some help about compiling a JavaFX code with external libraries. I've searched around a lot, but cant find the solution.
    Basically I have a JavaFX application, that uses images (they are under the src/ folder as they suggest it) and uses external .jar files, AND these jar files uses other external files (not jars). I want to run the application in desktop mode first, so now I am interested in a solution that makes it work on PC.
    I am using Netbeans to develop and run (works everything fine when running from IDE), and using javafxpackager to compile, when I want to run without the IDE.
    When I compile with Netbeans, the generated jar and jnlp files can run ONLY from the dist/ folder, if I copy it somewhere else in my winchester, it does not start.
    I have find something about "signing jars", so I have to make the jars signed to be able to run them AND to be able to link to the image files that the application uses.
    So I have 2 problems/questions with this situation:
    - I have to use external jars and those jars uses external files, but when I start the app, it seems its __DIR__ variable is not set correctly, but I've read that I have to make the application "signed" to solve this problem, but
    - if I make the JavaFX signed, it requires that all other jars have to be signed? (it sounds logical of course)
    So, my final question is, do I have to make the application (and all other jars) signed, to be able to use external jars and files or not (if I want to run as a desktop application)?
    And if I have to make them signed, then will the relative linking work correctly?
    So whats the best way to make it work (using external files and jars)?
    Thanks for any help, and sorry for the long post (and for my bad english) :)
    Cheers
    kojak

    kojak wrote:
    When I compile with Netbeans, the generated jar and jnlp files can run ONLY from the dist/ folder, if I copy it somewhere else in my winchester, it does not start.Unfortunately JNLP requires the base location to be stored in the JNLP file. While that supposedly makes JNLP distributed stuff more secured, it also make them cumbersome and time-consuming to use.
    Futhermore, JNLP files generated by NetBeans reference a local web server that only runs when NetBeans is on.
    That explains why you just simply cannot move the app to the location you want. I you move them, you have to open them (any text editor) and modify the codebase field (possibly the homepage's href too).
    If you want to use only 1 single JNLP, all your JARs references in that JNLP need to be signed with the very same certificate (certificate A).
    Unfortunately, this is not good most of the time as some external lib (generally the ones coming from Sun/Oracle) are already signed and you cannot resign them.
    The other option is that you can make your main JNLP reference other sub-JNLP that are placed at the same location. Each of these sub-JNLP can reference 1 or more JARs that are signed with a different certificate (1st JNLP used certificate B, 2nd JNLP used certificate C, etc.).
    An example adapted from my own main JNLP:
    <resources>
        <java version="1.6+"/>
        <jar href="http://<intranet web server>/<my main JAR file>" download="eager" main="true"/>
        <extension href="http://dl.javafx.com/1.3/javafx-rt.jnlp" name="JavaFX 1.3.x Runtime"/>
        <extension href="http://<intranet web server>/l2fprod-7.3.jnlp" name="l2fprod-7.3"/>
        <extension href="http://<intranet web server>/JFXtras-0.7.jnlp" name="JFXtras-0.7"/>
        ...and JFXtras-0.7.jnlp:
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="http://<intranet web server>" href="JFXtras-0.7.jnlp">
        <information>
            <title>JFXtras-0.7</title>
            <vendor>JFXtras</vendor>
            <homepage href="http://code.google.com/p/jfxtras/"/>
            <description>Additionnal controls for JavaFX</description>
            <offline-allowed/>
        </information>
        <security>
           <all-permissions/>
        </security>
        <resources>
           <jar href="lib/JFXtras-Common-0.7rc2.1.jar" main="false" download="eager" size="1309380"/>
           <jar href="lib/JFXtras-Controls-0.7rc2.jar" main="false" download="eager" size="1453233"/>
           <extension name="MigLayout-3.7" href="MigLayout-3.7.jnlp"/>
           <extension name="SwingWorker-1.2" href="SwingWorker-1.2.jnlp"/>
        </resources>
        <component-desc/>
    </jnlp>Both JARs files in that particular JNLP can be signed with a different certificate from the one of the main jar, same wit the JARs listed in the 2 sub-JNLPs that are referenced here.
    Note: of course, currently, JARs provided by JFXtras are note signed, so I end having to sign them myself anyway, but you get the idea.
    Unfortunately NetBeans does not generate such setup so you'll have to find a tool or develop something that does that for you.
    Perhaps you should try to post your question in the web start forum Java Web Start & JNLP as well but be prepared to face the all knowledgeable and always helpful but not very user-friendly and definitely not patient with new comers Andrew Thompson.
    Note that I've never used external files so I do not know if signing the JAR would fix that particular issue (I do not think so).
    Overall I do not like Java Web Start, as said before, it's cumbersome, time-consuming to use, poorly documented, with basically very little to no packaging/helper tool, prone to failure if you make the slightest mistake in the JNLP(s) definition (having a nebulous documentation of its feature does not help) and they've introduced a stream of bugs and errors with each sub-release of Java 6 for the past year and the half that makes programmer's life a hell and JWS a joke compared to other deployment technologies used by competitors.

  • JavaFX with AspectJ

    Hello,
    I'm working on a project which is on one hand very GUI oriented, and on the other hand needs very strong and maintainable code.
    One of the features I need to implement is monitoring user activity during run-time. After some discussion, it was decided integrating AspectJ into the code would be the best solution, instead of placing Observer design-patterns all over the place.
    Only one trouble remains: the project uses JavaFX for GUI :(
    Since AspectJ uses a Weaver, we thought it might be possible to first run the AspectJ weaver on our Java code, and then run the JavaFX normally. (No need to have aspects inside of the JavaFX)
    However, we have no idea how to do just that!
    Does anyone have any idea how to do this? We're a group of developers, and we work via SVN on eclipse - so we pretty much need this solution to integrate into eclipse, so we can run and debug the program normally.
    I think that if we can solve this, we can manage creating an executable later on, but if you have any tips on that front it would be welcome.
    Thanks in advance!!

    The NetBeans 6.5 support is planned only before SDK 1.0
    See issue [137990 |http://www.netbeans.org/issues/show_bug.cgi?id=137990] Missing required dependency with nightly NetBeans 6.5 build

  • JavaFX with Database

    i need your help.
    i have a question. plz answer me.
    when i use table or tree in JavaFX using "Letters", i could see these on the web page(get the information from "words")
    (ProjectName->mouse right button click->choose Properties->choose RUN->click RuninBrowser comboBox)
    but, when i make a table and tree using Database, i cannot see these on the web page.(get the information from DB)
    what's the problem?
    JavaFX doesn't support this?

    I am not sure I fully understood the question, so excuse me if I doesn't address it.
    Mu guess is that you made a JavaFX program accessing a database at a given URL, and you try to use this script in the browser, without result.
    The issue is probably that the database is located in a different server than your Web page with the applet, so standard Java security kicks in.
    You need to sign the applet to let it access resources on different server.
    HTH.

  • JavaFX with LibGDX, or Xith3D?

    Just curious if FX is compatible with any of these?  I thought I saw something on FXExperience about Xith3D and a new port for JavaFX8, but I don't think so.
    I heard you can add a LibGDX object to a Scene though.
    Not too sure which is better, both seem good but I would like to work with FX, as Xith says it works with either Swing or AWT..... 
    I want to create some 3D Goodies, but the 3D API is still very new, and there are soo many bugs that need to be fixed.  I like helping out with reports, but it's very overwhelming, and time is passing by.
    I like that LibGDX is for Mobile and WebGL though!
    Thoughts?

    In your javafx applications you can use standard java, so you can write any kind of project. JavaFx use special storage API. If you need something else u have to use java and maybe better on server side.

  • JavaFX with RTL lang?

    have visual component of JavaFX support RTL(right to left) language?
    Which property do that on textBox for example?

    The NetBeans 6.5 support is planned only before SDK 1.0
    See issue [137990 |http://www.netbeans.org/issues/show_bug.cgi?id=137990] Missing required dependency with nightly NetBeans 6.5 build

  • JavaFX with TreeGrid

    Good morning, I'm new here on the forum and am having some difficulties to test TreeGrid with JavaFX.
    To do this, I'm calling a html file in javafx, which aims only draw TreeGrid.
    The way I'm doing the TreeGrid returns the following error:
    [0]: Empty xml received from server from
    [0]: Can not load XML based TreeGrid
    [0]: Unknown style
    [0]: Empty xml received from server from
    In tag <bdo> I'm passing the values and Layout_Data Data_Data fixed and Upload_Format = 'json'.
    Looking at it, I thought the files and Text.xml DEFAULTS.XML were not being found, so I got to add the values Text_Url = "Grid / Text_xml" and Defaults_Url = "Grid / DEFAULTS.XML" but still giving error (have also verified the existence of these files).
    [0]: Empty xml received from server from Text_Url = 'Grid / Text.xml'
    [0]: Can not load XML based TreeGrid
    [0]: Unknown style
    [0]: Empty xml received from server from Defaults_Url = 'Grid / DEFAULTS.XML'
    So I would like to do with you as this can be fixed or if it really is possible to use TreeGrid with JavaFX.
    Thank you.

    In tag <bdo>I googled the bdo tag because I had never heard of it:
    http://www.w3schools.com/tags/tag_bdo.asp
    It is for specifying the direction of bidirectional text.
    bidirectional text is currently not supported in JavaFX, so it is unlikely to be supported in a html page hosted in WebView.
    Empty xml received from server fromYou were trying to load the html file from an internal jar resource, not hosted on a server, so that won't work unless the html file/javascript loaded has some absolute reference to a server and you actually have a server to return valid xml comsumable by whatever javascript control you are using.
    As other parts of your app are implemented in JavaFX, one approach you might want to consider is using the built-in Tree and Grid controls in JavaFX to achieve what you want rather than embedding javascript/html in WebView.

  • HowTo: Compilie JavaFX with Ant (without netbeans build-impl.xml)?

    Howdy, see subject :)
    Cheers!

    Here's a cleaner solution....
    1. Download and install the SDK on your machine
    2. Copy the SDK installation files into your project (I copied c:\Program Files\JavaFX\javafx-sdk-1.0 to ./Resources/JavaFX/. in my project) - this is used for compilation only and not packaged with distro.
    You might want to now uninstall the SDK for accurate testing
    3. Configure Ant (as below).....
    Since I put my JavaFX SDK in my project under ./Resources/JavaFX/javafx-sdk1.0 you will see this occur in the config below.
    <?xml version="1.0"?>
    <project name="MyJavaFXProject" default="compile" basedir=".">
      <path id="javafx.classpath">
            <fileset dir="./Resources/JavaFX/javafx-sdk1.0/lib">
                <include name="**/*.jar" />
            </fileset>
      </path>
      <taskdef classname="com.sun.tools.javafx.ant.JavaFxAntTask" name="javafxc">
            <classpath refid="javafx.classpath" />
      </taskdef>
      <target name="compile" depends="prepare" description="compile java and fx source">
            <javac srcdir="./Source/Java" destdir="./build/classes" includes="**/*.java"/>
            <javafxc srcdir="./Source/Java" destdir="./build/classes" includes="**/*.fx" executable="./Resources/JavaFX/javafx-sdk1.0/bin/javafxc.exe">
                <classpath refid="javafx.classpath" />
            </javafxc>
      </target>
      <target name="prepare" description="create build directory for compiler output">
        <mkdir dir="./build"/>
        <mkdir dir="./build/classes"/>
      </target>
      <target name="clean">
        <delete includeemptydirs="true">
          <fileset dir="build" includes="**/*"/>
        </delete>
      </target>
    </project>Hope this helps someone, and p.s.... if you are a maven user.. perhaps you can repackage the JavaFX SDK and install it in a Maven repository.

  • JPopupMenu with JInternalFrame, popup menu doesn't work

    hi, i have this problem, as shown in the sample code at the end of this post.. basically, i have a table, and i added a JPopupMenu onto the table.. the popup menu works well when running the table class, though, when i call the table class in a JInternalFrame environment, the popup menu won't work.. anyone know why?
    ///Basic sample table code, when run this alone, the popup menu will work
    import java.util.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class TableBasic extends JPanel
         private JTable table;
         public TableBasic()
              String[] columnNames = { "Date", "String", "Integer", "Boolean" };
              Object[][] data =
                   {  { new Date(), "A", new Integer(1), Boolean.TRUE },
                        { new Date(), "B", new Integer(2), Boolean.FALSE },
                        { new Date(), "C", new Integer(9), Boolean.TRUE },
                        { new Date(), "D", new Integer(4), Boolean.FALSE}
              table = new JTable(data, columnNames)
                   //Returning the Class of each column will allow different
                   //renderers to be used based on Class
                   public Class getColumnClass(int column)
                        return getValueAt(0, column).getClass();
              table.setPreferredScrollableViewportSize(table.getPreferredSize());
              JScrollPane scrollPane = new JScrollPane(table);
              add(scrollPane);
         public void createPopupMenu()
              JMenuItem menuItem;
              //Create the popup menu.
              JPopupMenu popup = new JPopupMenu();
              menuItem = new JMenuItem("A popup menu item");
              //menuItem.addActionListener(this);
              popup.add(menuItem);
              menuItem = new JMenuItem("Another popup menu item");
              //menuItem.addActionListener(this);
              popup.add(menuItem);
              //Add listener to the text area so the popup menu can come up.
              MouseListener popupListener = new PopupListener(popup);
              table.addMouseListener(popupListener);
         public static void main(String[] args)
              JFrame frame = new JFrame();
              TableBasic table = new TableBasic();
              table.createPopupMenu();
              frame.setContentPane(table);
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.pack();
              //frame.setLocationRelativeTo(null);
              frame.setVisible(true);
         class PopupListener extends MouseAdapter
              JPopupMenu popup;
              PopupListener(JPopupMenu popupMenu)
                   popup = popupMenu;
              public void mousePressed(MouseEvent e)
                   maybeShowPopup(e);
              public void mouseReleased(MouseEvent e)
                   maybeShowPopup(e);
              private void maybeShowPopup(MouseEvent e)
                   if (e.isPopupTrigger())
                        popup.show(e.getComponent(), e.getX(), e.getY());
    ///when integrate the previous table into here, popup menu won't work
    import java.awt.*;
    import javax.swing.*;
    public class InternalFrameBasic
         extends JFrame
         //implements ActionListener
         private JDesktopPane desktop;
         private JInternalFrame menuWindow;
         public static final int desktopWidth = 800;
         public static final int desktopHeight = 700;
         public InternalFrameBasic(String title)
              super(title);
              //Set up the GUI.
              desktop = new JDesktopPane();
              desktop.putClientProperty("JDesktopPane.dragMode", "outline");
              //Because we use pack, it's not enough to call setSize.
              //We must set the desktop's preferred size.
              desktop.setPreferredSize(new Dimension(desktopWidth, desktopHeight));
              setContentPane(desktop);
              createMenuWindow();
              desktop.add(menuWindow); //DON'T FORGET THIS!!!
              Dimension displaySize = menuWindow.getSize();
              menuWindow.setSize(desktopWidth, displaySize.height);
         private void createMenuWindow()
              menuWindow =
                             new JInternalFrame("Event Watcher", true, //resizable
                                                                                                   true, //closable
                                                                                                   false, //not maximizable
                                                                                                   true); //iconifiable
              menuWindow.setContentPane(new TableBasic());
              menuWindow.pack();
              menuWindow.setVisible(true);
          * Create the GUI and show it.  For thread safety,
          * this method should be invoked from the
          * event-dispatching thread.
         private static void createAndShowGUI()
              //Make sure we have nice window decorations.
              //JFrame.setDefaultLookAndFeelDecorated(true);
              //Create and set up the window.
              JFrame frame = new InternalFrameBasic("Example Internal Frame");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              //Display the window.
              frame.pack();
              frame.setVisible(true);
         public static void main(String[] args)
              //Schedule a job for the event-dispatching thread:
              //creating and showing this application's GUI.
              javax.swing.SwingUtilities.invokeLater(new Runnable()
                   public void run()
                        createAndShowGUI();
    }

    table.createPopupMenu();The above line should not be in the main method. It should be in the constructor class of TableBasic.
    You never execute that method in your InternalFrameBasic class to the mouse listener never gets added to the table.

  • JavaFX with iPad and other Tablets...

    Hi,
    can i run JavaFX code on iPad4 and iPhone ?? on other tablets like Nexus - Galaxy ...
    How can i make programming on iPad -iPhone using Java and JavaFX ??
    it seems that no intersection between iPadiPhone and Java ..? Really ??
    Many thanks

    jsmith wrote:
    A tablet you built yourself using a Raspberry Pi or Beagleboard (using embedded JavaFX preview releases) => Yes.Lol, now that's a complete list :) I'm going to start listing "stuff you built yourself" too.
    >
    no intersection between iPadiPhone and Java ..?CorrectThe blame is of course to be placed upon Apple and all their rules (yay lets all program Objective C and basically be forced to resort to low level C also, because I say so), and Google for basically ripping Java for their own purposes and thus breaking up what could have been a thing of beauty. Hopefully in a couple of years Dalvik will be as good as the JVM built into Java 5 :/

  • Working with JInternalFrames

    Hi,
    I am working on a desktop application based on Swing. We have the mainframe on which we have an internal frame. From this internal frame I need to invoke another internal frame. I am not able to do this. That is because I first need to add any internal frame to some container, generally a desktop pane. But how do I do that? I don't have a reference to the desktop pane in any of the internal frames. Is there a way I can retrieve it or do I need to pass it to every internal frame when invoking it. Please comment.
    Thanks.

    Hi Pradyumna,
    That's odd.
    import java.awt.Component;
    import javax.swing.JDesktopPane;
    import javax.swing.JInternalFrame;
    import javax.swing.SwingUtilities;
    public class TestInternalFrame {
        public static void main(String[] args) {
         SwingUtilities.invokeLater(new Runnable() {
             @Override
             public void run() {
              JDesktopPane desktop = new JDesktopPane();
              JInternalFrame frame = new JInternalFrame();
              desktop.add(frame);
              Component parent = frame.getParent();
              if (parent == desktop) {
                  System.out.println("Yes, I have got the desktop");
              } else {
                  System.out.println("Desktop" + desktop);
                  System.out.println("Parent " + parent);
    }The above code prints out (at least for me): Yes, I have got the desktop
    Am I missing something?
    Piet

  • Having trouble with JInternalFrame

    I posted about this and was advised that self-contained runnable code is a better way of illustrating the problem.
    I've written up an app which replicates the class structure and makes the same calls as a real app but is compilable and runnable.
    The problem is in the last 3 lines of MyJInternalFrame class, (which I have commented out).
    I want to trap an event in my JTable which is displayed in an instance of MyJInternalFrame and then display some data taken from the table in another JInternalFrame but this class structure won't allow it.
    I'm pretty sure that I am being dumb, but I hope someone can help point me in the right direction!
    Regards
    Paul
    package selfcontained;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JInternalFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.ListSelectionModel;
    import javax.swing.event.ListSelectionEvent;
    import javax.swing.event.ListSelectionListener;
    @author Paul Wilkin - to replicate problem.
    public class MyOuterFrame extends JFrame implements ActionListener {
    JButton myButton;
    JPanel myPanel;
    public MyOuterFrame(){
    super("Problem Demo");
    myPanel = new JPanel();
    myButton = new JButton("Press Me");
    myButton.addActionListener(this);
    myPanel.add(myButton);
    this.getContentPane().add(myPanel);
    this.setSize(100,100);
    this.setVisible(true);
    public void actionPerformed(ActionEvent e) {
    myJInternalFrame myIF = new myJInternalFrame();
    myIF.setVisible(true);
    myPanel.add(myIF);
    this.setSize(550,550);
    public static void main(String[] args) {
    javax.swing.SwingUtilities.invokeLater(new Runnable(){
    public void run() {
    createAndShowGUI();
    private static void createAndShowGUI(){
    try{
    //String PLAFName = UIManager.getSystemLookAndFeelClassName();
    // UIManager.setLookAndFeel(PLAFName);
    MyOuterFrame frame = new MyOuterFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setVisible(true);
    } catch (Exception e){
    System.out.println("Exception caught" + e);
    class myJInternalFrame extends JInternalFrame{
    JTable myJTable;
    public myJInternalFrame(){
    this.setSize(100,100);
    String [] headings = {"Column 1","Column 2"};
    Object [][] data = {{"Entry 1a","Entry 2a"},{"Entry 1b","Entry 2b"}};
    myJTable = new JTable(data,headings);
    myJTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    this.getContentPane().add(new JScrollPane(myJTable),"Center");
    ListSelectionModel myLSM = myJTable.getSelectionModel();
    myLSM.addListSelectionListener(new ListSelectionListener() {
    public void valueChanged(ListSelectionEvent le) {
    int[] rows = myJTable.getSelectedRows();
    // myJInternalFrame newIF = new myJInternalFrame();
    // newIF.getContentPane().add(new JLabel(rows.toString()));
    // myPanel.add(newIF);
    }

    posted about this and was advised that self-contained runnable code is a better way of illustrating the problem. It also helps if you post readable code. I'm sure you don't write your code left aligned so don't expect us to read it unformatted.
    class myJInternalFrame extends JInternalFrame
        JTable myJTable;
        JLabel label;
        public myJInternalFrame()
            this.setSize(100,100);
            String [] headings = {"Column 1","Column 2"};
            Object [][] data = {{"Entry 1a","Entry 2a"},{"Entry 1b","Entry 2b"}};
            myJTable = new JTable(data,headings);
            myJTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            this.getContentPane().add(new JScrollPane(myJTable),"Center");
            label = new JLabel(" ");
            add(label, BorderLayout.SOUTH);
            ListSelectionModel myLSM = myJTable.getSelectionModel();
            myLSM.addListSelectionListener(new ListSelectionListener()
                public void valueChanged(ListSelectionEvent le)
                    if (! le.getValueIsAdjusting())
                        label.setText("Selected: " + myJTable.getSelectedRow());
    }I really don't understand your question. You say you want to display data from the table yet I don't see any code that attempts to reference the table. So I just threw together a quick demo that may provide some ideas.

  • Strange behavior with JInternalframe

    ...or maybe i dont really know what im doing (most likely). Im using the netbeans ide, let me make that clear first.
    anyway, it seems that if i set a number of properties on the internal frame such as inconifiable, closeable, maximizable etc... and leave the size to preferred, the internal frame wont show up when the app is launched. i will have to narrow it down further, but its weird and cant explain it yet.
    is there any combination of window properties that would cause a JInternalFrame not to show ?

    I usually just call setBounds() & setVisible(). I don't think JDesktopPane pays any attention to preferred size.

Maybe you are looking for

  • WLAN Sync does not work after Update to version 10.5.1

    Today I have updated my iTunes to version 10.5.1. Before the update my iPhone was showed under Devices in iTunes and I could start the WLAN Sync directly from iTunes. After the update my iPhone is only showed when I connect it via the USB-Cable. I ca

  • How do I save my new data into a new .xls file? i am running my VI in a continious mode

    I am using a Data Acquisition Board to get my pressure and displacement signals. Have to measure it continiously. I am able to save the data continiously but not in new XLS file for new experiment. If any of you could hepl me with it

  • Need Service Tax calculation

    Dear All, I am rasing a service PO with the value of 500 INR. Then i am giving tax code as S1 (10,2,1% +4% VAT Service tax code).  it is not calcuating the taxes. Our tax procedure is TAXINN. maintianed the condition type for S1 tax code using FV11 T

  • When I import music, iTunes 8 creates duplicates in library

    When I drag and drop music from a folder into iTunes 8, itunes will create a duplicate for every song. I tried unchecking "Copy Files To iTunes Music Folder..." in Preferences>Advanced. It still does it. Help please.

  • How to view exception alerts in a dashboard

    Hi Experts, We are currently migrating our system from BW 3.5 to Netweaver 2004s (7.0). There were a few Reporting Agent settings which precalculated alerts on exceptions in a query and the alerts could be viewed by the user in a dashboard through we