简体   繁体   English

用户在JAVA FX中生成的帐户

[英]User-generated account in JAVA FX

I am currently designing a little dice game that should involve a feature, which allows the user to create his own account by typing in a name and a password. 我目前正在设计一个小骰子游戏,该游戏应包含一项功能,该功能允许用户通过输入名称和密码来创建自己的帐户。

I've been thinking about using a constructor within the Account.java class, but i still haven't figured out how it is possible to permanently store user input so it is available the next time you run the application. 我一直在考虑在Account.java类中使用构造函数,但是我仍然没有弄清楚如何永久存储用户输入,以便下次运行该应用程序时可以使用它。 How do I go about storing more than one piece of information (in this case username and password) in the same object? 如何在同一个对象中存储多个信息(在这种情况下为用户名和密码)?

Any advice? 有什么建议吗? Does this type of class probably already exist in JAVA or JAVA FX? JAVA或JAVA FX中可能已经存在这种类型的类吗?

Thanks for your help ;) 谢谢你的帮助 ;)

You could always opt for an embedded solution, and since you are using Java you might want to give H2 a go: https://gist.github.com/jewelsea/4955598 您始终可以选择嵌入式解决方案,并且由于您正在使用Java,因此您可能想尝试一下H2: https//gist.github.com/jewelsea/4955598

Here is a Git project showing how to use H2: http://www.h2database.com/html/main.html 这是一个显示如何使用H2的Git项目: http : //www.h2database.com/html/main.html

Sounds like a Database is what you need. 听起来像是您需要的数据库。

http://www.devx.com/Java/Article/48193 http://www.devx.com/Java/Article/48193

this is a tutorial with Postgresql and javafx. 这是有关Postgresql和javafx的教程。

Have at it! 加油!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM