如何解决找不到变量 JOptionPane
public class NetManager extends Thread {
public Multipart mp;
public String host,username,password;
public NetManager(String username,String password)
{
this.host = "imap.gmail.com";
this.username = username;
this.password = password;
}
private Session getImapSession() {
Properties props = new Properties();
props.setProperty("mail.store.protocol","imap");
props.setProperty("mail.debug","false");
props.setProperty("mail.imap.host","imap.gmail.com");
props.setProperty("mail.imap.port","993");
props.setProperty("mail.imap.ssl.enable","true");
Session session = Session.getDefaultInstance(props,null);
session.setDebug(true);
return session;
}
public Folder getMailBox()
{
try
{
Session currentSession = getImapSession();
Store store = currentSession.getStore("imap");
store.connect(host,password);
IMAPFolder inBox = (IMAPFolder)store.getFolder("INBox");
inBox.open(Folder.READ_ONLY);
return inBox;
}
catch (Exception e)
{
System.out.println(e.getMessage());
return null;
}
}
public void run() {
super.run();
Folder inBox = getMailBox();
try {
int counter = 0;
Message[] messg = inBox.getMessages();
for (int i = 0; i < messg.length; i++)
{
if(messg[i].getSubject().equals("check"))
{
mp = (Multipart) messg[i].getContent();
}
}
} catch (MessagingException | IOException e) {
System.out.println("Error");
}
}
解决方法
int a=JoptionPane.show..
应该是:
int a=JOptionPane.show..
Java 区分大小写,选项窗格的第一个 'o' 是大写的 'O'。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。