• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem in repaint?

 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wow! It really works now. Thank you very much sir rob..
 
Rob Spoor
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're welcome, but I haven't been knighted (yet), so there's no need for the "sir"
 
Those who dance are thought mad by those who hear not the music. This tiny ad plays the bagpipes:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic