2011-12-07 5 views
10

मैं शायद बेवकूफ सवाल के लिए क्षमा चाहता हूं लेकिन मुझे ऑनलाइन जवाब नहीं मिला।मैं नेटबीन फॉर्म और इसकी कक्षा को इंटेलिजे आईडीईए फॉर्म एडिटर में उपयोग करने योग्य कुछ कैसे बदल सकता हूं?

मुझे कुछ यूआई कोड मिला है जो नेटबीन में बनाया गया था। दुर्भाग्य से मुझे नहीं पता कि किस संस्करण का उपयोग किया गया था। मेरी समझ यह है कि IntelliJ IDEA (मेरे मामले में v11) NetBeans रूपों का समर्थन नहीं करता है।

क्या मैं फॉर्म को आईडीईए के फॉर्म एडिटर में उपयोग करने योग्य कुछ में परिवर्तित कर सकता हूं? फॉर्म की एक्सएमएल फ़ाइल की सामग्री यह झूठ दिखती है:

<?xml version="1.1" encoding="UTF-8" ?> 

<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> 
    <NonVisualComponents> 
    <Component class="javax.swing.JLabel" name="jLabel3"> 
     <Properties> 
     <Property name="text" type="java.lang.String" value="jLabel3"/> 
     </Properties> 
    </Component> 
    <Menu class="javax.swing.JMenuBar" name="menuBar"> 
     <SubComponents> 
     <Menu class="javax.swing.JMenu" name="fileMenu"> 
      <Properties> 
      <Property name="mnemonic" type="int" value="102"/> 
      <Property name="text" type="java.lang.String" value="File"/> 
      </Properties> 
      <SubComponents> 
      <MenuItem class="javax.swing.JMenuItem" name="openMenuItem"> 
       <Properties> 
       <Property name="mnemonic" type="int" value="111"/> 
       <Property name="text" type="java.lang.String" value="Open"/> 
       </Properties> 
      </MenuItem> 
      <MenuItem class="javax.swing.JMenuItem" name="saveMenuItem"> 
       <Properties> 
       <Property name="mnemonic" type="int" value="115"/> 
       <Property name="text" type="java.lang.String" value="Save"/> 
       </Properties> 
      </MenuItem> 
      <MenuItem class="javax.swing.JMenuItem" name="saveAsMenuItem"> 
       <Properties> 
       <Property name="mnemonic" type="int" value="97"/> 
       <Property name="text" type="java.lang.String" value="Save As ..."/> 
       <Property name="displayedMnemonicIndex" type="int" value="5"/> 
       </Properties> 
      </MenuItem> 
      <MenuItem class="javax.swing.JMenuItem" name="exitMenuItem"> 
       <Properties> 
       <Property name="mnemonic" type="int" value="120"/> 
       <Property name="text" type="java.lang.String" value="Exit"/> 
       </Properties> 
       <Events> 
       <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="exitMenuItemActionPerformed"/> 
       </Events> 
      </MenuItem> 
      </SubComponents> 
     </Menu> 
     <Menu class="javax.swing.JMenu" name="editMenu"> 
      <Properties> 
      <Property name="mnemonic" type="int" value="101"/> 
      <Property name="text" type="java.lang.String" value="Edit"/> 
      </Properties> 
      <SubComponents> 
      <MenuItem class="javax.swing.JMenuItem" name="cutMenuItem"> 
       <Properties> 
       <Property name="mnemonic" type="int" value="116"/> 
       <Property name="text" type="java.lang.String" value="Cut"/> 
       </Properties> 
      </MenuItem> 
      <MenuItem class="javax.swing.JMenuItem" name="copyMenuItem"> 
       <Properties> 
       <Property name="mnemonic" type="int" value="121"/> 
       <Property name="text" type="java.lang.String" value="Copy"/> 
       </Properties> 
      </MenuItem> 
      <MenuItem class="javax.swing.JMenuItem" name="pasteMenuItem"> 
       <Properties> 
       <Property name="mnemonic" type="int" value="112"/> 
       <Property name="text" type="java.lang.String" value="Paste"/> 
       </Properties> 
      </MenuItem> 
      <MenuItem class="javax.swing.JMenuItem" name="deleteMenuItem"> 
       <Properties> 
       <Property name="mnemonic" type="int" value="100"/> 
       <Property name="text" type="java.lang.String" value="Delete"/> 
       </Properties> 
      </MenuItem> 
      </SubComponents> 
     </Menu> 
     <Menu class="javax.swing.JMenu" name="helpMenu"> 
      <Properties> 
      <Property name="mnemonic" type="int" value="104"/> 
      <Property name="text" type="java.lang.String" value="Help"/> 
      </Properties> 
      <SubComponents> 
      <MenuItem class="javax.swing.JMenuItem" name="contentsMenuItem"> 
       <Properties> 
       <Property name="mnemonic" type="int" value="99"/> 
       <Property name="text" type="java.lang.String" value="Contents"/> 
       </Properties> 
      </MenuItem> 
      <MenuItem class="javax.swing.JMenuItem" name="aboutMenuItem"> 
       <Properties> 
       <Property name="mnemonic" type="int" value="97"/> 
       <Property name="text" type="java.lang.String" value="About"/> 
       </Properties> 
      </MenuItem> 
      </SubComponents> 
     </Menu> 
     </SubComponents> 
    </Menu> 
    </NonVisualComponents> 
    <Properties> 
    <Property name="defaultCloseOperation" type="int" value="3"/> 
    <Property name="title" type="java.lang.String" value="My Reporting"/> 
    </Properties> 
    <SyntheticProperties> 
    <SyntheticProperty name="menuBar" type="java.lang.String" value="menuBar"/> 
    <SyntheticProperty name="formSizePolicy" type="int" value="1"/> 
    </SyntheticProperties> 
    <AuxValues> 
    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> 
    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> 
    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> 
    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> 
    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> 
    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/> 
    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> 
    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> 
    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> 
    </AuxValues> 

    <Layout> 
    <DimensionLayout dim="0"> 
     <Group type="103" groupAlignment="0" attributes="0"> 
      <Group type="102" attributes="0"> 
       <EmptySpace max="-2" attributes="0"/> 
       <Group type="103" groupAlignment="0" attributes="0"> 
        <Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/> 
        <Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/> 
        <Group type="102" alignment="1" attributes="0"> 
         <Component id="dataRequestButton" min="-2" max="-2" attributes="0"/> 
         <EmptySpace min="99" pref="99" max="99" attributes="0"/> 
        </Group> 
       </Group> 
       <EmptySpace max="-2" attributes="0"/> 
       <Group type="103" groupAlignment="0" attributes="0"> 
        <Component id="downloadButton" min="-2" max="-2" attributes="0"/> 
        <Component id="answersLoaded" alignment="0" min="-2" max="-2" attributes="0"/> 
        <Component id="answersToLoad" alignment="0" min="-2" max="-2" attributes="0"/> 
       </Group> 
       <EmptySpace min="-2" pref="28" max="-2" attributes="0"/> 
      </Group> 
      <Component id="statusLabel" alignment="0" pref="574" max="32767" attributes="0"/> 
      <Group type="102" alignment="0" attributes="0"> 
       <EmptySpace min="-2" pref="32" max="-2" attributes="0"/> 
       <Component id="jLabel4" min="-2" max="-2" attributes="0"/> 
       <EmptySpace pref="493" max="32767" attributes="0"/> 
      </Group> 
      <Group type="102" alignment="0" attributes="0"> 
       <EmptySpace max="-2" attributes="0"/> 
       <Component id="jScrollPane1" pref="534" max="32767" attributes="0"/> 
       <EmptySpace max="-2" attributes="0"/> 
      </Group> 
     </Group> 
    </DimensionLayout> 
    <DimensionLayout dim="1"> 
     <Group type="103" groupAlignment="0" attributes="0"> 
      <Group type="102" alignment="0" attributes="0"> 
       <EmptySpace max="-2" attributes="0"/> 
       <Group type="103" groupAlignment="0" attributes="0"> 
        <Group type="102" alignment="1" attributes="0"> 
         <Component id="answersLoaded" min="-2" max="-2" attributes="0"/> 
         <EmptySpace max="-2" attributes="0"/> 
         <Component id="answersToLoad" min="-2" max="-2" attributes="0"/> 
        </Group> 
        <Group type="102" alignment="1" attributes="0"> 
         <Component id="jLabel1" min="-2" max="-2" attributes="0"/> 
         <EmptySpace max="-2" attributes="0"/> 
         <Component id="jLabel2" min="-2" max="-2" attributes="0"/> 
        </Group> 
       </Group> 
       <EmptySpace max="-2" attributes="0"/> 
       <Group type="103" groupAlignment="0" attributes="0"> 
        <Component id="dataRequestButton" alignment="0" min="-2" max="-2" attributes="0"/> 
        <Component id="downloadButton" alignment="0" min="-2" max="-2" attributes="0"/> 
       </Group> 
       <EmptySpace type="separate" max="-2" attributes="0"/> 
       <Component id="jLabel4" min="-2" max="-2" attributes="0"/> 
       <EmptySpace max="-2" attributes="0"/> 
       <Component id="jScrollPane1" pref="316" max="32767" attributes="0"/> 
       <EmptySpace type="unrelated" max="-2" attributes="0"/> 
       <Component id="statusLabel" min="-2" max="-2" attributes="0"/> 
      </Group> 
     </Group> 
    </DimensionLayout> 
    </Layout> 
    <SubComponents> 
    <Component class="javax.swing.JLabel" name="jLabel1"> 
     <Properties> 
     <Property name="text" type="java.lang.String" value="Answer data loaded until"/> 
     </Properties> 
    </Component> 
    <Component class="javax.swing.JLabel" name="answersLoaded"> 
     <Properties> 
     <Property name="text" type="java.lang.String" value="&lt;nothing loaded&gt;"/> 
     </Properties> 
    </Component> 
    <Component class="javax.swing.JLabel" name="jLabel2"> 
     <Properties> 
     <Property name="text" type="java.lang.String" value="Unloaded answers at the server"/> 
     </Properties> 
    </Component> 
    <Component class="javax.swing.JLabel" name="answersToLoad"> 
     <Properties> 
     <Property name="text" type="java.lang.String" value="&lt;nothing available&gt;"/> 
     </Properties> 
    </Component> 
    <Component class="javax.swing.JButton" name="downloadButton"> 
     <Properties> 
     <Property name="text" type="java.lang.String" value="Download ready data"/> 
     </Properties> 
     <Events> 
     <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="downloadButtonActionPerformed"/> 
     </Events> 
    </Component> 
    <Component class="javax.swing.JLabel" name="statusLabel"> 
     <Properties> 
     <Property name="text" type="java.lang.String" value="Ready"/> 
     <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> 
      <Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo"> 
      <EtchetBorder/> 
      </Border> 
     </Property> 
     </Properties> 
    </Component> 
    <Component class="javax.swing.JButton" name="dataRequestButton"> 
     <Properties> 
     <Property name="text" type="java.lang.String" value="Request data"/> 
     </Properties> 
     <Events> 
     <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="dataRequestButtonActionPerformed"/> 
     </Events> 
    </Component> 
    <Container class="javax.swing.JScrollPane" name="jScrollPane1"> 

     <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> 
     <SubComponents> 
     <Component class="javax.swing.JTable" name="engineTable"> 
      <Properties> 
      <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> 
       <Table columnCount="4" rowCount="4"> 
       <Column editable="true" title="Title 1" type="java.lang.Object"/> 
       <Column editable="true" title="Title 2" type="java.lang.Object"/> 
       <Column editable="true" title="Title 3" type="java.lang.Object"/> 
       <Column editable="true" title="Title 4" type="java.lang.Object"/> 
       </Table> 
      </Property> 
      <Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor"> 
       <TableColumnModel selectionModel="0"> 
       <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 
        <Title/> 
        <Editor/> 
        <Renderer/> 
       </Column> 
       <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 
        <Title/> 
        <Editor/> 
        <Renderer/> 
       </Column> 
       <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 
        <Title/> 
        <Editor/> 
        <Renderer/> 
       </Column> 
       <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> 
        <Title/> 
        <Editor/> 
        <Renderer/> 
       </Column> 
       </TableColumnModel> 
      </Property> 
      <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> 
       <TableHeader reorderingAllowed="true" resizingAllowed="true"/> 
      </Property> 
      </Properties> 
     </Component> 
     </SubComponents> 
    </Container> 
    <Component class="javax.swing.JLabel" name="jLabel4"> 
     <Properties> 
     <Property name="text" type="java.lang.String" value="Engines"/> 
     </Properties> 
    </Component> 
    </SubComponents> 
</Form> 

बहुत बहुत धन्यवाद।

+0

क्या आपने कोड की प्रतिलिपि/पेस्ट की कोशिश की है? इससे पहले कि मैं कल्पना करूंगा कि यह काम करेगा, मैंने कभी ऐसा नहीं किया है। –

+0

.java क्लास जो .form के साथ आता है? मुझे इसे कॉपी-पेस्ट कहां करना चाहिए? – expert

+2

आपको इंटेलिजे में उसी पैकेज में एक ही नाम के साथ एक कक्षा बनाना होगा और उसके बाद कोड को अपनी कक्षा से कॉपी/पेस्ट करना होगा। आप IntelliJ में फ़ाइल खोलने का प्रयास कर सकते हैं और देख सकते हैं कि IntelliJ इसे खोल देगा (इसे चाहिए)। NetBeans द्वारा उत्पन्न कोड मान्य जावा कोड है और .form फ़ाइल के बिना काम करेगा। .form फ़ाइल जीयूआई संपादक की सुविधा के लिए है और इसकी आवश्यकता नहीं है/.java क्लास को संकलित करने के लिए उपयोग नहीं किया जाता है। –

उत्तर

5

इंटेलिजे आईडीईए नेटबीन फॉर्म का समर्थन नहीं करता है, तो आप create snapshot सुविधा का उपयोग करने का प्रयास कर सकते हैं जो चल रहे एप्लिकेशन के संवाद से आईडीईए फॉर्म फ़ाइल को सहेज सकता है।

हालांकि, अधिक सुविधाजनक समाधान JFormDesigner का उपयोग करना होगा जिसमें IntelliJ IDEA प्लग-इन है और नेटबीन फॉर्म फ़ाइलों को परिवर्तित कर सकता है। ध्यान दें कि यह टूल वाणिज्यिक है और आपको पैसे खर्च होंगे, लेकिन यह कोशिश करने के लिए स्वतंत्र है।

+0

कल मैंने JFormDesigner 5.0.0 की कोशिश की और यह आईडीईए 11 में क्रैश हो रहा था। लेकिन संस्करण 5.0.2 ठीक काम करता है। मैं इसके साथ रहूंगा। धन्यवाद! – expert

+0

मान लीजिए कि मैं अपनी मूल्यांकन अवधि के दौरान से एक का निर्माण करता हूं और यदि लाइसेंस उस फॉर्म की तुलना में समाप्त हो जाएगा तो वह अभी भी काम करेगा या मैं इसे संशोधित नहीं कर सकता? –

संबंधित मुद्दे