Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem in repaint?  RSS feed

 
Aron Jhed Amiscosa
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi there.. i have a new problem...

i have 3 separate classes within a package...

lets name them main class and log in class and the connector class

the log in class has the access in the database to get the access level of the logging user...
the access level will determine the menus that will be available to the user depending on the access level...
the connector class now contains the getter and setter methods...

this is how it looks like...



this is the code in the log in form...



now this is how the main constructor looks like...


this is to limit the accessible menus depending to the user. it is set as all true in default...
the conn.getLevel(); returns the correct value.. but it doesnt seem to be repainting... and treats every user as level 0 even the returned value and the value passed is 2...
what do you guys think is the error...
 
Rob Spoor
Sheriff
Posts: 21048
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) use rs.getInt directly to save you the trouble of parsing the level

2) are you creating this form before or after the login has succeeded? If it happens before, then the pre-login value of 0 will be used, and you will need a method to update the main form based on the new level.
 
Aron Jhed Amiscosa
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Prime wrote:1) use rs.getInt directly to save you the trouble of parsing the level

2) are you creating this form before or after the login has succeeded? If it happens before, then the pre-login value of 0 will be used, and you will need a method to update the main form based on the new level.


thanks sir rob.. i changed my code to directly allocate the level. but i realized that it was of no use... the problem is at the process of logging in. i mean, at the log in phase, the username and the level is being parsed... thus getting the level and passing it to the Connector method. but the Connector method being called at the main form again, resets its values to 0... now, you suggested to create a method that will update the main form... that is something i really have no idea. >_>
so far, i tried the most possible options but still, i cant get any working solution... can you help me just on the updaterMethod you are talking about.. sorry, i really have no idea on how to work it...
 
Rob Spoor
Sheriff
Posts: 21048
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's really simple:
Then you call this method each time the login dialog is closed.
 
Aron Jhed Amiscosa
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow! It really works now. Thank you very much sir rob..
 
Rob Spoor
Sheriff
Posts: 21048
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome, but I haven't been knighted (yet), so there's no need for the "sir"
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!