• Post Reply Bookmark Topic Watch Topic
  • New Topic

accessing items in other classes  RSS feed

 
Preston Taylor
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



How do I get to the openTicket Function from my Info class? Class relationships is probably me weak point in java, with all the static non-static stuff.
I already have a way for someone to open a new internal fram from within this MainView Class but I want to be able to open the same internal frame from another class.


thanks for the help
BTW first post!
 
Rob Spoor
Sheriff
Posts: 21092
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) the Info instance needs a reference to the current object. You can use "this". For instance:

2) the OpenTicket methods needs to be visible for the Info class. If they are in the same package you can remove the "private" keyword and the method will have default access.
 
Preston Taylor
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
duh! I used the same exact solution elsewhere in the program lol thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!