Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Page 2 of 4 FirstFirst 1234 LastLast
Results 26 to 50 of 93

Thread: issue sending value to new pane

  1. #26
    Member
    Join Date
    Feb 2018
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: issue sending value to new pane

    omg....That is a youtube video. This isnt some third party scammer crap.

    button1 does not have any value assigned because it SERVES NO PURPOSE. button1 sole purpose is to bring the user to index2. You can clearly see this if you simply just read it.

    The video i am TRYING to get you to watch CLEARLY shows all of this. THERE IS NO DOWNLOAD. THERE IS NO SCAMMING OFFERS. THERE IS NO NIGERIAN PRINCE.

    https://www.youtube.com/watch?v=51H5...ature=youtu.be

    Same link!!

  2. #27
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: issue sending value to new pane

    button1 does not have any value assigned
    It must have a value.
    If it is not assigned a value, then the code will throw a NPE which is what I see.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #28
    Member
    Join Date
    Feb 2018
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: issue sending value to new pane

    clearly it doesnt for me. I dont know what you are using but mine compiles and executes just fine. Just assign a blank value? It never gets used.

    Take a screen shot on this error.

    Try executing it on IntelliJ

    I am also on Windows 7 64x Ultimate.

  4. #29
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: issue sending value to new pane

    I compile with javac.exe and execute with java.exe

    There are no compiler errors. There is a NPE when I try to execute it because button1 has no value.

    Just assign a blank value?
    That will not work. button1 is defined as a JButton so it needs to be assigned an instance of the JButton class.
    There are several possibilities for what argument is passed to the JButton's constructor including none.
    If you don't understand my answer, don't ignore it, ask a question.

  5. #30
    Member
    Join Date
    Feb 2018
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: issue sending value to new pane

    could it be that you need the .form files too?

    I use IntelliJ with the forms in the directory. It works flawlessly.

    I rared it all together but you stated you dont download third party files.

    That may very well be the issue.

  6. #31
    Member
    Join Date
    Feb 2018
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: issue sending value to new pane

    execute.jpg

    i just compiled it just fine on my machine.

  7. #32
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: issue sending value to new pane

    the .form files
    I don't know what they are. What are they for? Do they have anything to do with changing the source file before it is compiled?

    As I said, I use the files in the JDK to compile and the files in the JRE to execute. Otherwise I have a fancy editor to change the source.


    I'm leaving this problem to someone else that knows what form files are and how IntelliJ works.

    This has been a big waste of time trying to debug code that is just input to a program that changes it before compilation.
    If you don't understand my answer, don't ignore it, ask a question.

  8. #33
    Member
    Join Date
    Feb 2018
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: issue sending value to new pane

    have you compiled it with 9.0.1? It compiles just fine with 1.8.0

    I also switched my javac to 9.0.1 and was able to replicate the errors. I am just unsure as to how i can resolve that issue given that it works fine on 1.8.0.

  9. #34
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: issue sending value to new pane

    It compiles just fine with 1.8.0
    Can you post the actual source code that is compiled? The posted code is input for the IntelliJ program, not the code that is compiled by the javac program.
    I would like the output from the IntelliJ program where all the empty GUI components are given values, like button1, etc
    If you don't understand my answer, don't ignore it, ask a question.

  10. #35
    Member
    Join Date
    Feb 2018
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: issue sending value to new pane

    Norm....I dont know what you want me to say....Its the same source code. the code you see in IntelliJ is the same files i used to compile and execute using javac and java...

    Would you like me to record the entire process and show you step by step what i do?

  11. #36
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: issue sending value to new pane

    I think the code you have posted is input to the IntelliJ program. That program reads the .forms file(s)
    and CREATES A NEW JAVA SOURCE FILE that is then compiled and then executed.

    What I need to see is the NEW JAVA SOURCE FILE that is created by IntelliJ.
    That source file is complete. What you have posted is missing lots of code.
    If you don't understand my answer, don't ignore it, ask a question.

  12. #37
    Member
    Join Date
    Feb 2018
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: issue sending value to new pane

    I do not believe that an additional source file.

    Below i included the .form code.

    MainPage.form

    <?xml version="1.0" encoding="UTF-8"?>
    <form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="MainPage">
      <grid id="27dc6" binding="contentPane" layout-manager="CardLayout" hgap="0" vgap="0">
        <constraints>
          <xy x="20" y="20" width="500" height="400"/>
        </constraints>
        <properties/>
        <border type="none"/>
        <children>
          <grid id="ce719" binding="cardPanel" layout-manager="CardLayout" hgap="0" vgap="0">
            <constraints>
              <card name="Card1"/>
            </constraints>
            <properties/>
            <border type="none"/>
            <children/>
          </grid>
        </children>
      </grid>
    </form>

    Index.form

    <?xml version="1.0" encoding="UTF-8"?>
    <form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="Index">
      <grid id="27dc6" binding="panel" layout-manager="GridLayoutManager" row-count="4" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
        <margin top="0" left="0" bottom="0" right="0"/>
        <constraints>
          <xy x="20" y="20" width="500" height="400"/>
        </constraints>
        <properties/>
        <border type="none"/>
        <children>
          <component id="9f76a" class="javax.swing.JLabel" binding="lblamnt">
            <constraints>
              <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
            </constraints>
            <properties>
              <text value="Amount"/>
            </properties>
          </component>
          <component id="c2da9" class="javax.swing.JButton" binding="button1" default-binding="true">
            <constraints>
              <grid row="3" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
            </constraints>
            <properties>
              <text value="Button"/>
            </properties>
          </component>
          <component id="ac9b9" class="javax.swing.JButton" binding="btn1">
            <constraints>
              <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
            </constraints>
            <properties>
              <text value="1"/>
            </properties>
          </component>
          <component id="186ec" class="javax.swing.JButton" binding="btn2">
            <constraints>
              <grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
            </constraints>
            <properties>
              <text value="2"/>
            </properties>
          </component>
          <component id="7d59e" class="javax.swing.JButton" binding="btn3">
            <constraints>
              <grid row="1" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
            </constraints>
            <properties>
              <text value="3"/>
            </properties>
          </component>
          <component id="19f19" class="javax.swing.JButton" binding="btn4">
            <constraints>
              <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
            </constraints>
            <properties>
              <text value="4"/>
            </properties>
          </component>
          <component id="86edb" class="javax.swing.JButton" binding="btn5">
            <constraints>
              <grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
            </constraints>
            <properties>
              <text value="5"/>
            </properties>
          </component>
          <component id="86720" class="javax.swing.JButton" binding="btn0">
            <constraints>
              <grid row="2" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
            </constraints>
            <properties>
              <text value="0"/>
            </properties>
          </component>
          <component id="b4905" class="javax.swing.JButton" binding="btnD">
            <constraints>
              <grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
            </constraints>
            <properties>
              <text value=""/>
            </properties>
          </component>
          <component id="fb6e6" class="javax.swing.JLabel" binding="lblDisplay">
            <constraints>
              <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
            </constraints>
            <properties>
              <text value="Label"/>
            </properties>
          </component>
        </children>
      </grid>
    </form>

    Index2.form

    <?xml version="1.0" encoding="UTF-8"?>
    <form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="Index2">
      <grid id="27dc6" binding="panel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
        <margin top="0" left="0" bottom="0" right="0"/>
        <constraints>
          <xy x="20" y="20" width="500" height="400"/>
        </constraints>
        <properties/>
        <border type="none"/>
        <children>
          <component id="f54d2" class="javax.swing.JLabel" binding="lblgamnt">
            <constraints>
              <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
            </constraints>
            <properties>
              <text value="Amount 1234"/>
            </properties>
          </component>
        </children>
      </grid>
    </form>

    i compiled just fine on 1.8.0 using javac and executed it with java straight from the source code as you see posted.

  13. #38
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: issue sending value to new pane

    Sorry, those .form files are of no use to me. I need the updated source files that can compile.
    If you don't understand my answer, don't ignore it, ask a question.

  14. #39
    Member
    Join Date
    Feb 2018
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: issue sending value to new pane

    But what i gave you IS the source code...Like i dont know what to say here...I am currently posting in the IntelliJ forums to see if they are aware of this issue.

  15. #40
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: issue sending value to new pane

    What do you think the purpose of the .form files is? Why are they needed? What does the IntelliJ program do with them?

    Can you use the javac command to compile the code you posted and then try executing those class files using the java command?
    Do it without using the IntelliJ program and see what happens.
    If you don't understand my answer, don't ignore it, ask a question.

  16. #41
    Member
    Join Date
    Feb 2018
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: issue sending value to new pane

    it is part of the GUI designer tool. When you create a new GUI it creates a form with XML.

    https://intellij-support.jetbrains.c...but-java-cant-

    is the topic.

  17. #42
    Junior Member
    Join Date
    Feb 2018
    Posts
    5
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: issue sending value to new pane

    IntelliJ uses an external library to hande GUI creation. The IDE takes the .form files and parses the XML into java on the fly. There is a way to export the .form files as java source code directly from IntellJ right from the menu bar. More about that here:

    https://stackoverflow.com/questions/...orm-to-eclipse

  18. The Following User Says Thank You to brynpttrsn For This Useful Post:

    Norm (February 21st, 2018)

  19. #43
    Member
    Join Date
    Feb 2018
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: issue sending value to new pane

    hes using just java.exe. Not eclipse

  20. #44
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: issue sending value to new pane

    Sorry, I can't help you unless you post the java source code that will compile AND execute.
    If you don't understand my answer, don't ignore it, ask a question.

  21. #45
    Member
    Join Date
    Feb 2018
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: issue sending value to new pane

    Please stand by, im figuring out how this works. apparently there is an option that auto generate the code.

  22. #46
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: issue sending value to new pane

    A suggestion for your early learning of java - Get rid of the GUI builder. Learn to use java's layout managers.
    If your problems require people to install special software, there will probably be a lot fewer people willing to help.
    If you don't understand my answer, don't ignore it, ask a question.

  23. #47
    Member
    Join Date
    Feb 2018
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: issue sending value to new pane

    i ran the finished product with the classes and ran it ojn the raspberry pi no problems. But ill post this in the meantime. im waiting fr a response. Note the extra code below that was being omitted previously.

    MainPage.java

    import javax.swing.*;
    import java.awt.*;
     
    public class MainPage extends JDialog {
        private JPanel contentPane;
        private JPanel cardPanel;
     
        //GUI Forms
        final static String INDEX = "Index";
        final static String INDEX2 = "Index 2";
     
        //Card Layout Filler
        public void showPanel(String id) {
            final CardLayout cl = (CardLayout) cardPanel.getLayout();
            cl.show(cardPanel, id);
        }
     
        public MainPage() {
            setContentPane(contentPane);
            setModal(true);
            setDefaultCloseOperation(DISPOSE_ON_CLOSE);
     
            Index zero = new Index();
            zero.setParentForm(this);
            cardPanel.add(zero.getPanel(), INDEX);
     
            Index2 one = new Index2();
            one.setParentForm(this);
            cardPanel.add(one.getPanel(), INDEX2);
     
            //Initial form loading for default
            final CardLayout cl = (CardLayout) cardPanel.getLayout();
            cl.show(cardPanel, INDEX);
        }
     
        public static void main(String[] args) {
            MainPage dialog = new MainPage();
            dialog.pack();
            dialog.setVisible(true);
            System.exit(0);
        }
     
        {
    // GUI initializer generated by IntelliJ IDEA GUI Designer
    // >>> IMPORTANT!! <<<
    // DO NOT EDIT OR ADD ANY CODE HERE!
            $$$setupUI$$$();
        }
     
        /**
         * Method generated by IntelliJ IDEA GUI Designer
         * >>> IMPORTANT!! <<<
         * DO NOT edit this method OR call it in your code!
         *
         * @noinspection ALL
         */
        private void $$$setupUI$$$() {
            contentPane = new JPanel();
            contentPane.setLayout(new CardLayout(0, 0));
            cardPanel = new JPanel();
            cardPanel.setLayout(new CardLayout(0, 0));
            contentPane.add(cardPanel, "Card1");
        }
     
        /**
         * @noinspection ALL
         */
        public JComponent $$$getRootComponent$$$() {
            return contentPane;
        }
    }

    Index.java

    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
     
    public class Index {
        private JPanel panel;
        private JLabel lblamnt;
        private JButton button1;
        private JButton btn1;
        private JButton btn2;
        private JButton btn3;
        private JButton btn4;
        private JButton btn5;
        private JButton btn0;
        private JButton btnD;
        private JLabel lblDisplay;
        private MainPage parentForm;
        public static String tval = "";
     
        public Index() {
            button1.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    parentForm.showPanel(MainPage.INDEX2);
                }
            });
            btn0.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    tval = tval + 0;
                    lblamnt.setText(tval);
                }
            });
            btn1.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    tval = tval + 1;
                    lblamnt.setText(tval);
                }
            });
            btn2.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    tval = tval + 2;
                    lblamnt.setText(tval);
                }
            });
            btn3.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    tval = tval + 3;
                    lblamnt.setText(tval);
                }
            });
            btn4.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    tval = tval + 4;
                    lblamnt.setText(tval);
                }
            });
            btn5.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    tval = tval + 5;
                    lblamnt.setText(tval);
     
                }
            });
            btnD.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    lblDisplay.setText(tval);
                }
            });
        }
     
        public static String tgval() {
            return tval;
        }
     
        public void setParentForm(final MainPage parentForm) {
            this.parentForm = parentForm;
        }
     
        public JPanel getPanel() {
            return panel;
        }
     
        {
    // GUI initializer generated by IntelliJ IDEA GUI Designer
    // >>> IMPORTANT!! <<<
    // DO NOT EDIT OR ADD ANY CODE HERE!
            $$$setupUI$$$();
        }
     
        /**
         * Method generated by IntelliJ IDEA GUI Designer
         * >>> IMPORTANT!! <<<
         * DO NOT edit this method OR call it in your code!
         *
         * @noinspection ALL
         */
        private void $$$setupUI$$$() {
            panel = new JPanel();
            panel.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(4, 3, new Insets(0, 0, 0, 0), -1, -1));
            lblamnt = new JLabel();
            lblamnt.setText("Amount");
            panel.add(lblamnt, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
            button1 = new JButton();
            button1.setText("Button");
            panel.add(button1, new com.intellij.uiDesigner.core.GridConstraints(3, 0, 1, 3, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
            btn1 = new JButton();
            btn1.setText("1");
            panel.add(btn1, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
            btn2 = new JButton();
            btn2.setText("2");
            panel.add(btn2, new com.intellij.uiDesigner.core.GridConstraints(1, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
            btn3 = new JButton();
            btn3.setText("3");
            panel.add(btn3, new com.intellij.uiDesigner.core.GridConstraints(1, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
            btn4 = new JButton();
            btn4.setText("4");
            panel.add(btn4, new com.intellij.uiDesigner.core.GridConstraints(2, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
            btn5 = new JButton();
            btn5.setText("5");
            panel.add(btn5, new com.intellij.uiDesigner.core.GridConstraints(2, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
            btn0 = new JButton();
            btn0.setText("0");
            panel.add(btn0, new com.intellij.uiDesigner.core.GridConstraints(2, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
            btnD = new JButton();
            btnD.setText("");
            panel.add(btnD, new com.intellij.uiDesigner.core.GridConstraints(0, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
            lblDisplay = new JLabel();
            lblDisplay.setText("Label");
            panel.add(lblDisplay, new com.intellij.uiDesigner.core.GridConstraints(0, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
        }
     
        /**
         * @noinspection ALL
         */
        public JComponent $$$getRootComponent$$$() {
            return panel;
        }
    }

    Index2.java

    import javax.swing.*;
    import java.awt.*;
     
    public class Index2 {
        private JPanel panel;
        private JLabel lblgamnt;
        private MainPage parentForm;
        Index gg = new Index();
     
        public Index2() {
            lblgamnt.setText(getter());
            System.out.println(getter());
        }
     
        public static String getter() {
            return Index.tval;
        }
     
        public void setParentForm(final MainPage parentForm) {
            this.parentForm = parentForm;
        }
     
        public JPanel getPanel() {
            return panel;
        }
     
        {
    // GUI initializer generated by IntelliJ IDEA GUI Designer
    // >>> IMPORTANT!! <<<
    // DO NOT EDIT OR ADD ANY CODE HERE!
            $$$setupUI$$$();
        }
     
        /**
         * Method generated by IntelliJ IDEA GUI Designer
         * >>> IMPORTANT!! <<<
         * DO NOT edit this method OR call it in your code!
         *
         * @noinspection ALL
         */
        private void $$$setupUI$$$() {
            panel = new JPanel();
            panel.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
            lblgamnt = new JLabel();
            lblgamnt.setText("Amount 1234");
            panel.add(lblgamnt, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
        }
     
        /**
         * @noinspection ALL
         */
        public JComponent $$$getRootComponent$$$() {
            return panel;
        }
    }

  24. #48
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: issue sending value to new pane

    The posted code uses 3rd party packages. I get this error: error: package com.intellij.uiDesigner.core does not exist

    Please re-write the code to use standard java SE classes. See post#46
    If you don't understand my answer, don't ignore it, ask a question.

  25. #49
    Member
    Join Date
    Feb 2018
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: issue sending value to new pane

    i read your post. When the user gets this they dont need special software. the device will be locked up so they wont have access to the pi itself. it will be in a case. I just ran it on my raspberry pi compiled and it works fine...

    Anyways I was able to get it to work and compile and execute no problems.

    Please review this video showing the compiling and executing without issues. This is using javac and java commands together.

    https://youtu.be/jovEvQLpU10

    Source code along with the .jar and the library in the com folder is also included.

  26. #50
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: issue sending value to new pane

    the user gets this they dont need special software
    Where is the package com.intellij.uiDesigner.core? I don't have it. Without it the code won't compile and will not execute.

    I was able to get it to work
    Glad you have solved you problem.
    If you don't understand my answer, don't ignore it, ask a question.

Page 2 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. Replies: 0
    Last Post: December 7th, 2017, 12:55 PM
  2. Help incorporating a Joption Pane
    By Dysun in forum What's Wrong With My Code?
    Replies: 1
    Last Post: April 15th, 2012, 05:25 PM
  3. What exactly is a content pane?
    By TP-Oreilly in forum Java Theory & Questions
    Replies: 2
    Last Post: December 7th, 2011, 09:07 AM
  4. Sending large Strings ?! only sending a line
    By camel in forum Java Networking
    Replies: 2
    Last Post: April 19th, 2011, 12:41 PM
  5. JOption Pane help
    By dallas1125 in forum AWT / Java Swing
    Replies: 5
    Last Post: November 18th, 2009, 05:08 PM