Menu

How to change the HyperFrame to a JPanel?

Help
seeker1006
2007-10-20
2013-04-26
  • seeker1006

    seeker1006 - 2007-10-20

    Hi,
      Not come here for a long time,because I was confused with a difficult problem as following:

    I'm very like the function of our Hypernotes. So I want to embed our Hypernotes into another java application programme. So the problem comes. The java application programme already has a "JFrame" as the user interface. So I have to change the HyperFrame of the Hypernotes frome a JFrame to a JPanel. After delete and change some sourcecodes,for example:I delete the menubar ; I add a "Open2" item to the popmenu which has had the itum "Create New", "Delete", "Rename" ,I want to open a saved file through this "Open2" item.

    And then the main function likes following:

    public class MainTest {
    public static void main(String[] args){

            JFrame jframe = new JFrame();
            jframe.setTitle("Test");
            JPanel contentpane = (JPanel)jframe.getContentPane();
            HyperFrame hf = HyperFrame.getActiveFrame();
            if(hf == null)
                hf = new HyperFrame();
            hf.setNode(n);
            contentpane.add(hf);
            jframe.setSize(200,200);
            jframe.setVisible(true);
      }
      }

    But the result is:The Hypernotes'interface can be seen in the UI,but when I try to use the "Open2" to open a saved file, it catches the following information:

    "Couldn't load from the file"

    How can I to do ?

    Thanks very much !

     
    • seeker1006

      seeker1006 - 2007-10-20

      I have a purpose to exploit two java application programme. The first one will be the Hypernotes which should be consummated . The other one will be an java application programme which already has it's user interface and some other function.I want to embed the Hypernotes sourcecode to the java application programme ,so it can interpret the files which the Hypernotes saved.

      My purpose is above. So can you give me some adivse and the answsers for the
      former question.

      Very appreciated for your help!

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.