Java 数组到JLabel

Java 数组到JLabel,java,arrays,string,swing,Java,Arrays,String,Swing,我有两个java类的包 PKStrings PkJforms 我有带菜单的JFrame A点击进入JA帧 B单击go jframe B C单击go jframe C D单击go JD帧 和同一包装中的其他框架 JFram01,包含JLabel 如何识别您是否单击“A”并显示该位置标签?据我所知,您可以在包中使用公共变量,并使用A、B、C上的单击事件将值存储在其中 I dont understand your need. "A click A go jframe A" doesnot m

我有两个java类的包

  • PKStrings
  • PkJforms

我有带菜单的
JFrame

  • A点击进入JA帧

    B单击go jframe B

    C单击go jframe C

    D单击go JD帧

和同一包装中的其他框架
JFram01
,包含
JLabel


如何识别您是否单击“A”并显示该位置标签?

据我所知,您可以在包中使用公共变量,并使用A、B、C上的单击事件将值存储在其中

I dont understand your need. "A click A go jframe A" doesnot make sense.
if you want to go to another jFrame when clicking a label
Try this

    private void yourlabelMouseClicked(java.awt.event.MouseEvent evt) {
          //  either you can hide the current jFrame by setting 
            jFrame.setVisible(false);
            newjFrame.setVisible(True);
                    or
            make these jFrames in 2 different classes that make simple invocations
        }
然后从你想要的jfaram访问这些信息

e、 g


如果我在jbutton“add”中单击标题集“add”,请检查我在Classwork包含标题页的类中的练习。当单击jbutton Sumas(menuFrame.java)时,从数组字符串标题菜单示例“Suma”中设置operacionsframe.java上的标题菜单。导入pkWorking.Classwork;String[]newMenu=newclasswork().titleMenu;查看my Practice mediafire.com/?pjf7w6x9l6b62g8“A单击转到jframe A,B单击转到jframe B,C单击转到jframe C,D单击转到jframe D”啊!有关“大量视图”的信息,请参阅。这最好使用
卡片布局来完成。有关如何使用
卡片布局来完成此操作的信息,请参阅(以及使用
作业窗格来选择卡片)。
I dont understand your need. "A click A go jframe A" doesnot make sense.
if you want to go to another jFrame when clicking a label
Try this

    private void yourlabelMouseClicked(java.awt.event.MouseEvent evt) {
          //  either you can hide the current jFrame by setting 
            jFrame.setVisible(false);
            newjFrame.setVisible(True);
                    or
            make these jFrames in 2 different classes that make simple invocations
        }
public String pos ="";

A onclick event(){
   pos="A";
}


finally

if(pos.compareto("A")==0){
   jlabel.settext("A");
}