nolife33033 0 Share Posted August 8, 2021 It is hard to explain what I am having a problem with but I will give it my best shot. I have one package that contains multiple classes. I have 1. MainClass 2. Areas 3.Task 4. GUI I have a GUI that I am trying to receive input from. Example( Selecting what logs to burn) I can get the string to implement it on my MainClass but I cant figure out how to be able to use the string in my other classes. Most of my banking,burning and other code is wrote in my Class: Task and I cant figure out a way to implement strings from my GUI to my Class: Task. Link to comment Share on other sites More sharing options...
SubCZ 255 Share Posted August 8, 2021 (edited) https://docs.oracle.com/javase/tutorial/java/javaOO/variables.html Edited August 8, 2021 by SubCZ Link to comment Share on other sites More sharing options...
nolife33033 0 Author Share Posted August 8, 2021 I have the Access Modifier as public but can not use it in the class:Task for some reason. public String getLogType() { return logType.getSelectedItem().toString(); } Link to comment Share on other sites More sharing options...
Pandemic 2434 Share Posted August 8, 2021 20 minutes ago, nolife33033 said: I have the Access Modifier as public but can not use it in the class:Task for some reason. public String getLogType() { return logType.getSelectedItem().toString(); } You'd have to pass the GUI you created to your Task class Link to comment Share on other sites More sharing options...
nolife33033 0 Author Share Posted August 9, 2021 The problem is I have to pass it to class: MainClass to use in there aswell and can't figure out how to pass to both classes. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now