一、通过手机访问mq.3g.qq.com,选择对应的手机下载
二、通过电脑访问mobile.qq.com,选择对应的手机下载
注:一些手机只支持200或300kb以下的java文件!感谢您对手机QQ的支持,祝您心情愉快。
你好。游戏大厅目前还没有java版本的。只有智能系统才可以下载游戏大厅。不过你可以下载单个的java游戏。比如欢乐斗地主什么的都支持的。欢迎登陆3g.qq.com手机腾讯网下载体验。祝愉快。望采纳因为密码框会将内容用*替换,为了便于检验,我用的是文本框,密码框的道理是一样的。注意,由于复制粘帖时可能出现不一致,使用的时候请确认一下没有在不允许换行的地方换行。
import javax.swing.JFrame
import javax.swing.JTextField
import javax.swing.JCheckBox
import javax.swing.JButton
import javax.swing.JOptionPane
import java.awt.event.ActionListener
import java.awt.event.ActionEvent
import java.io.File
import java.io.FileReader
import java.io.FileWriter
import java.io.FileNotFoundException
import java.io.IOException
public class SavePSW
{
private JFrame myFrame
private JTextField myTextF
private JCheckBox myCheckB
private JButton myButton
public SavePSW()
{
}
//初始化应用程序窗口,大部分代码包含在这里
public void iniGUI()
{
final File pswFile = new File("psw.txt")
FileReader freader
myFrame = new JFrame("Save Password")
myFrame.setLayout(new java.awt.FlowLayout())
myTextF = new JTextField(12)
myCheckB = new JCheckBox("Save Password")
myButton = new JButton("Submit")
//判断是否存在保存密码的文件,如果存在则将其内容写入文本框
if (pswFile.exists() &&pswFile.canRead())
{
try
{
freader = new FileReader(pswFile)
try
{
int tempInt
StringBuffer tempStr = new StringBuffer()
while ((tempInt=freader.read())!=-1)
{
tempStr.append((char)tempInt)
}
myTextF.setText(tempStr.toString())
}
catch (IOException ioe)
{
System.out.println("IOException")
}
finally
{
try
{
freader.close()
}
catch (IOException ioe)
{
System.out.println("IOException")
}
}
}
catch (FileNotFoundException fe)
{
System.out.println("FileNotFoundException")
}
}
//给按钮添加事件监听
myButton.addActionListener(new ActionListener()
{
FileWriter fwriter
public void actionPerformed(ActionEvent e)
{
//如果checkbox未选中,返回
if (!myCheckB.isSelected())
{
JOptionPane.showMessageDialog(myFrame, "You choose not saving the password", "No Saving", JOptionPane.INFORMATION_MESSAGE)
System.exit(0)
}
//如果文件不存在
if (!pswFile.exists())
{
try
{
pswFile.createNewFile()
}
catch (IOException ioe)
{
System.out.println("IOException")
}
}
//如果文件不可写
if (!pswFile.canWrite())
{
JOptionPane.showMessageDialog(myFrame, "Password Saved Faild\nFile may NOT be writable", "Faild", JOptionPane.ERROR_MESSAGE)
System.exit(0)
}
//写入新密码
try
{
fwriter = new FileWriter(pswFile)
String tempStr = myTextF.getText()
fwriter.write(tempStr, 0, tempStr.length())
}
catch (FileNotFoundException fe)
{
System.out.println("FileNotFoundException")
}
catch (IOException ioe)
{
System.out.println("IOException")
}
finally
{
try
{
fwriter.flush()
fwriter.close()
}
catch (IOException ioe)
{
System.out.println("IOException")
}
}
//提示用户保存成功,退出系统。
JOptionPane.showMessageDialog(myFrame, "Password Saved", "Succeed", JOptionPane.INFORMATION_MESSAGE)
System.exit(0)
}
})
myFrame.add(myTextF)
myFrame.add(myCheckB)
myFrame.add(myButton)
myFrame.setBounds(300, 300, 400, 300)
myFrame.setVisible(true)
myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
}
public static void main(String[] args)
{
new SavePSW().iniGUI()
}
}
补充:我当然知道这样不安全,但是你的问题中只是要实现这个功能,我辛辛苦苦写了这么多代码,然后你又说不安全,为什么你开始不说呢?
你到底是要一种思路还是要一个成型的软件?如果是后者,你去找软件公司花钱请人家帮你做不是很好?
难道我还要给你开发一个可解密的加密算法,实现用数据库保存密码,然后双手捧着对你说:“请笑纳”?