2个回答
展开全部
public class ItemEvent事件
{
public static void main(String args[])
{
WindowOperation win=new WindowOperation();
win.setBounds(100,100,390,360);
win.setTitle("简单计算器");
}
}
import java.awt.event.*;
import javax.swing.*;
public class OperatorListener implements ItemListener
{
JComboBox choice;
ComputerListener workTogether;
public void setJComboBox(JComboBox box)
{
choice=box;
}
public void setWorkTogether(ComputerListener computer)
{
workTogether=computer;
}
public void itemStateChanged(ItemEvent e)
{
String fuhao=choice.getSelectedItem().toString();
workTogether.setFuhao(fuhao);
}
}
{
public static void main(String args[])
{
WindowOperation win=new WindowOperation();
win.setBounds(100,100,390,360);
win.setTitle("简单计算器");
}
}
import java.awt.event.*;
import javax.swing.*;
public class OperatorListener implements ItemListener
{
JComboBox choice;
ComputerListener workTogether;
public void setJComboBox(JComboBox box)
{
choice=box;
}
public void setWorkTogether(ComputerListener computer)
{
workTogether=computer;
}
public void itemStateChanged(ItemEvent e)
{
String fuhao=choice.getSelectedItem().toString();
workTogether.setFuhao(fuhao);
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
我们实习的时候编的就是这个,我可以发给你,告诉我你的邮箱
更多追问追答
追问
扣扣:965737912简单易懂的代码就行,谢啦~
追答
已发,你看看
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询