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 282 Share Posted August 8, 2021 https://docs.oracle.com/javase/tutorial/java/javaOO/variables.html 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 2711 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
Archived
This topic is now archived and is closed to further replies.