Advertisement
Guest User

Untitled

a guest
Sep 13th, 2017
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. The code itself:
  2.  
  3. public static void UserConfigLoad() {
  4. try{
  5. Properties p = new Properties();
  6. p.load(new FileInputStream("user.ini"));
  7. myUsername = p.getProperty("Username");
  8. myPassword = p.getProperty("Password");
  9. fixed = p.getProperty("FixedScreen");
  10. }
  11. catch (Exception e) {
  12. System.out.println(e);
  13. }
  14. }
  15.  
  16. public void UserConfigSave() {
  17. try{
  18. Properties p = new Properties();
  19. p.load(new FileInputStream("user.ini"));
  20. p.put("Username",""+ myUsername +"");
  21. p.put("Password",""+ myPassword +"");
  22. p.put("FixedScreen",""+ fixed +"");
  23. FileOutputStream out = new FileOutputStream("user.ini");
  24. p.save(out, "/* Server Info Updated */");
  25. }
  26. catch (Exception e) {
  27. System.out.println(e);
  28. }
  29. }
  30.  
  31. Fixedscreen is a boolean so its either true or false.
  32. Username is a string.
  33.  
  34.  
  35. Error Compiling:
  36.  
  37. client.java:80: non-static variable fixed cannot be referenced from a static con
  38. text
  39. fixed = p.getProperty("FixedScreen");
  40. ^
  41. client.java:80: incompatible types
  42. found : java.lang.String
  43. required: boolean
  44. fixed = p.getProperty("FixedScreen");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement