How do I use the results of an action?

I'm trying to pass some information from user inputs back into my code but I don't really know how to go about it. Basically, I'm making a Swing application that builds an XML file with a lot of repetitive lines and the idea is that the user will be able to input the unique values for each line, and the program will fill in the rest. I have a dialog open with several text fields for the user to input information, once the user is done, I store the contents of these fields in a List and then (after checking for bad input) use the List to create an object with the user data in the fields. I then need to add the toString of that object to the next line of my final output. The problem is, the information doesn't exist until the user presses the button, I don't know how to tell my code to "wait" until the button is pressed before continuing execution. I guess I'm trying to use swing to make my own, more complicated JOptionpane.showInputDialogue, where instead of returning a String it returns a list of Strings, but it still pauses execution until the strings are confirmed.
95 Replies
JavaBot
JavaBot2mo ago
This post has been reserved for your question.
Hey @Devin! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
Devin
DevinOP2mo ago
No description
dan1st
dan1st2mo ago
what if the user modifies one of the previous fields?
JavaBot
JavaBot2mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Devin
DevinOP2mo ago
Clicking the button to confirm the contents of the fields would close the dialog and open the next one
dan1st
dan1st2mo ago
then the UI could call the code doing the XML thing whenever doing what which part of that is the problem? XML streaming?
JavaBot
JavaBot2mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Devin
DevinOP2mo ago
The problem isn't calling it, I guess my issue is my loop is in the wrong place?
dan1st
dan1st2mo ago
idk you haven't told me what issue you are facing but maybe you want some system with listeners or something where the background functionality "waits" on the UI, e.g. using a BlockingQueue
Devin
DevinOP2mo ago
Okay so I have a main method running all the logic, and then another one in a different class that makes the UI show up. This is for like, building an input display using XML and custom images
dan1st
dan1st2mo ago
Is all the logic really in the main method?
Devin
DevinOP2mo ago
no the logic is mostly elsewhere, I don't know what to call what goes in main god this is sloppy, I'd send a code snippet but I doubt it means anything unless I comment it.
Devin
DevinOP2mo ago
Basically I have a loop in main that sets currentInput to be a CustomInput (which is an object I made for this), and it does this by calling the class that opens the window in the UI class
No description
Devin
DevinOP2mo ago
So I want the UI class to open the window, collect the information, and then return an object created with that information so then I can call the toString method of that object to print the next line to my XML file.
Devin
DevinOP2mo ago
No description
Devin
DevinOP2mo ago
I guess this is really where the issue lives I display a prompt, and then I need the results of what the user inputs before returning to main
dan1st
dan1st2mo ago
then call some method in every iteration that does the updating? or you could have a BlockingQueue and two threads: The thread doing the UI logic inserts elements (input) and the other thread that performs the logic takes the elements out of the queue
Devin
DevinOP2mo ago
How do I tell things which thread to use?
Devin
DevinOP2mo ago
I have it set up like this right now, but for some reason none of the UI elements appear in the window
No description
Devin
DevinOP2mo ago
this is despite the fact that they are all added before I changed the code
Devin
DevinOP2mo ago
No description
Devin
DevinOP2mo ago
Notably, it DOES work if I run it from outside of my main loop with similar parameters???
No description
Devin
DevinOP2mo ago
It works with the same inputs in a loop as long as I run it from main which why does the same code do different things in different places? is it because the other view is already open???
/**
* Takes user-generated values for each button, analog, and stick, and compiles them into a formatted XML file
* @param templateIndex Number referencing which file in the template directory to use for a template
*/
public static void startBuild(int templateIndex){
int currentInputType = -1; //This needs to be updated so we know if we are adding a button, analog, or stick
CustomInput currentInput; // This will be set based on user generated values
String[] items = null; //items should be null until values are read from the template file
IOHandler output = new IOHandler("Output\\skin.xml", true); //this basically just makes a PrintWriter
IOHandler input = new IOHandler(IOHandler.getTemplateDirectories().get(templateIndex), false); //this basically just makes a Scanner
input.read(); //equivalent of Scanner.nextLine()
//write header for XML file
output.write(input.current);
String skinName = JOptionPane.showInputDialog("Input Skin Name");
String authorName = (JOptionPane.showInputDialog("Input Author Name") + "using the Devini15 XML Builder");
String backGroundImage = JOptionPane.showInputDialog("Input Name of Background Image\n(should end in .png or .jpg");
input.read();
output.write(input.current.replaceFirst("NAME", skinName).replaceFirst("AUTHOR", authorName));
input.read();
output.write(input.current.replaceFirst("IMAGE",backGroundImage));
//write contents of xml file
while(input.hasNextLine()){
input.read();
if(input.current.contains("<!--")) currentInputType = setCurrentInputType(input.current); //<!-- indicates we are swiching to a new input type
else items = input.current.replace(" ", "").split(","); //array of all inputs on this line
if(currentInputType == -1){ //check to make sure input type was set before we start filling things out
System.out.println("ERROR: Problem reading template.\n " +
"Please be sure to follow the formatting guide in the readme");
System.exit(1); //shhhhhhh
}
if(items != null) for(String currentInputName : items){//if items exists, do this for each item
System.out.println("Current input name = " + currentInputName + " Current input type = " + currentInputType);
currentInput = DisplayBuilderUI.showPromptWindow("Enter information for \"" + currentInputName + "\"", currentInputType, currentInputName); //THIS LINE SHOULD WORK
output.write(currentInput.toString()); //this just writes the XML to the output file
}
items = null; //resets items for next loop
}
output.close();
}
/**
* Takes user-generated values for each button, analog, and stick, and compiles them into a formatted XML file
* @param templateIndex Number referencing which file in the template directory to use for a template
*/
public static void startBuild(int templateIndex){
int currentInputType = -1; //This needs to be updated so we know if we are adding a button, analog, or stick
CustomInput currentInput; // This will be set based on user generated values
String[] items = null; //items should be null until values are read from the template file
IOHandler output = new IOHandler("Output\\skin.xml", true); //this basically just makes a PrintWriter
IOHandler input = new IOHandler(IOHandler.getTemplateDirectories().get(templateIndex), false); //this basically just makes a Scanner
input.read(); //equivalent of Scanner.nextLine()
//write header for XML file
output.write(input.current);
String skinName = JOptionPane.showInputDialog("Input Skin Name");
String authorName = (JOptionPane.showInputDialog("Input Author Name") + "using the Devini15 XML Builder");
String backGroundImage = JOptionPane.showInputDialog("Input Name of Background Image\n(should end in .png or .jpg");
input.read();
output.write(input.current.replaceFirst("NAME", skinName).replaceFirst("AUTHOR", authorName));
input.read();
output.write(input.current.replaceFirst("IMAGE",backGroundImage));
//write contents of xml file
while(input.hasNextLine()){
input.read();
if(input.current.contains("<!--")) currentInputType = setCurrentInputType(input.current); //<!-- indicates we are swiching to a new input type
else items = input.current.replace(" ", "").split(","); //array of all inputs on this line
if(currentInputType == -1){ //check to make sure input type was set before we start filling things out
System.out.println("ERROR: Problem reading template.\n " +
"Please be sure to follow the formatting guide in the readme");
System.exit(1); //shhhhhhh
}
if(items != null) for(String currentInputName : items){//if items exists, do this for each item
System.out.println("Current input name = " + currentInputName + " Current input type = " + currentInputType);
currentInput = DisplayBuilderUI.showPromptWindow("Enter information for \"" + currentInputName + "\"", currentInputType, currentInputName); //THIS LINE SHOULD WORK
output.write(currentInput.toString()); //this just writes the XML to the output file
}
items = null; //resets items for next loop
}
output.close();
}
This is the ENTIRE method what part of this code is breaking the window?? it has to be something here, because if it was an issue in the UI class, it would still happen when I call DisplayBuilderUI.ShowPromptWindow from main is it because I have a FileInputStream and FileOutputStream open? like I can't fathom why the window is just frozen with no UI
dan1st
dan1st2mo ago
if you are doing something else in the thread handling the UI, it will freeze until it's done
Devin
DevinOP2mo ago
how do I know what thread I'm using for what?
dan1st
dan1st2mo ago
you could do something like that
private final BlockingQueue<String> queue = new LinkedBlockingQueue<>();

void ui(){
for(...){
String currentInput = ...;
queue.offer(currentInput);
}
}

void logic() {
try{
String firstString = queue.take();
//process here
String secondString = queue.take();
//further processing with second string
//...
} catch(InterruptedException e){
Thread.currentThread.interrupt();
}
}
private final BlockingQueue<String> queue = new LinkedBlockingQueue<>();

void ui(){
for(...){
String currentInput = ...;
queue.offer(currentInput);
}
}

void logic() {
try{
String firstString = queue.take();
//process here
String secondString = queue.take();
//further processing with second string
//...
} catch(InterruptedException e){
Thread.currentThread.interrupt();
}
}
new Thread(() -> ui()).start();
new Thread(() -> logic()).start();
new Thread(() -> ui()).start();
new Thread(() -> logic()).start();
making sure both threads share the BlockingQueue
Devin
DevinOP2mo ago
I am not at all familiar with BlockingQueue, I don't know how to use one.
dan1st
dan1st2mo ago
BlockingQueue is a Queue meaning you can insert elements and take them out in the order of insertion (first in first out)
Devin
DevinOP2mo ago
It needs to be a field of the class should it be in my main class or my UI class?
dan1st
dan1st2mo ago
BlockingQueues have the ability that you can do that with in a way that it waits for the elements to be inserted you can have them in different classes as long as both have the same BlockingQueue
Devin
DevinOP2mo ago
I can put BlockingQueues in different classes as long as they have the same BlockingQueue?
dan1st
dan1st2mo ago
yes
Devin
DevinOP2mo ago
uh does it need a thread to wait for the thing to happen?
dan1st
dan1st2mo ago
public class YourUIClass {
private final BlockingQueue<String> queue;

public YourUIClass(BlockingQueue<String> queue) {
this.queue = queue;
}

public void ui(){
for(...){
String currentInput = ...;
queue.offer(currentInput);
}
}
}
public class YourUIClass {
private final BlockingQueue<String> queue;

public YourUIClass(BlockingQueue<String> queue) {
this.queue = queue;
}

public void ui(){
for(...){
String currentInput = ...;
queue.offer(currentInput);
}
}
}
public class YourLogicClass {
private final BlockingQueue<String> queue;

public YourLogicClass(BlockingQueue<String> queue) {
this.queue = queue;
}

void logic() {
try{
String firstString = queue.take();
//process here
String secondString = queue.take();
//further processing with second string
//...
} catch(InterruptedException e){
Thread.currentThread.interrupt();
}
}
}
public class YourLogicClass {
private final BlockingQueue<String> queue;

public YourLogicClass(BlockingQueue<String> queue) {
this.queue = queue;
}

void logic() {
try{
String firstString = queue.take();
//process here
String secondString = queue.take();
//further processing with second string
//...
} catch(InterruptedException e){
Thread.currentThread.interrupt();
}
}
}
BlockingQueue<String> queue = new LinkedBlockingQueue<>();
YourUIClass ui = new YourUIClass(queue);
YourLogicClass logic = new YourLogicClass(queue);
new Thread(ui::ui).start();
new Thread(logic::logic).start();
BlockingQueue<String> queue = new LinkedBlockingQueue<>();
YourUIClass ui = new YourUIClass(queue);
YourLogicClass logic = new YourLogicClass(queue);
new Thread(ui::ui).start();
new Thread(logic::logic).start();
Devin
DevinOP2mo ago
okay I don't get all of it yet, but let me know if I'm on track here I have
private static final BlockingQueue<CustomInput> queue = new LinkedBlockingQueue<>();
private static final BlockingQueue<CustomInput> queue = new LinkedBlockingQueue<>();
This is sitting in my fields. I'm not waiting for individual strings, but a whole CustomInput object, so I made it take those. all the strings will be ready at the same time then
dan1st
dan1st2mo ago
yeah you can also do something else
Devin
DevinOP2mo ago
I replaced the commented code in my showPromptWindow method with this
No description
Devin
DevinOP2mo ago
and then here I offer the queue a button instead of setting the currentInput to a button directly
No description
dan1st
dan1st2mo ago
maybe consider one big try catch over all the queue.take() calls I meant you would call offer() whenever you get user input
Devin
DevinOP2mo ago
I only have one take call, I don't collect the user input one box at a time the user input becomes the button
dan1st
dan1st2mo ago
whenever you want the next user input, call take() like you would do with Scanner#nextLine and whenever you get new user input, you offer()
Devin
DevinOP2mo ago
I think that is what I am doing. User Input is like, 5 strings that are all submitted at once next user input would be the same I don't know how it would help to only accept one string at a time, the choke point comes in before the user is allowed to input anything at all.
dan1st
dan1st2mo ago
You mean 5 inputs for one button?
Devin
DevinOP2mo ago
yeah hold on
dan1st
dan1st2mo ago
if you have a variable number of inputs per button, you could also use a String[]
Devin
DevinOP2mo ago
dan1st
dan1st2mo ago
oh ok it's always the same
Devin
DevinOP2mo ago
I'll always know how many inputs I'm looking at. Each input type has it's own toString Method that knows how to handle any case. The number of available fields is determined by an input type ID
Devin
DevinOP2mo ago
Here's a little UML diagram I made of only the CustomInput class and it's children
No description
Devin
DevinOP2mo ago
idk if it's helpful to you but now you have it. Anyway, I know that if the user inputs information and clicks the button, everything after that works All I need is for the user to be shown the text fields.
dan1st
dan1st2mo ago
So the approach works?
Devin
DevinOP2mo ago
approach? here's what happens when I run the code outside of that little debug thing I showed you
Devin
DevinOP2mo ago
Devin
DevinOP2mo ago
I think it MAYBE has to do with the output stream trying to use the same thread that's supposed to handle drawing the UI?? In which case I could just use a StringBuilder to assemble the output and then print it all to the file as one massive string after I'm done collecting input but that's a pain in the ass I don't want to have to refactor for unless I know it would fix things. Oh, but the sample video I sent you DID use the BlockedQueue version of the code instead of the while loop with delay so at least that's working lol
dan1st
dan1st2mo ago
What is the UI code there? like where are you showing the window that freezes?
Devin
DevinOP2mo ago
Oh
public static CustomInput showPromptWindow(String prompt, int inputType, String inputName){
currentInputName = inputName;
JFrame promptFrame = new JFrame();
promptFrame.setTitle(prompt);
promptFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
promptFrame.setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
promptFrame.setLocationRelativeTo(null);

//ExpectingField is a subclass of DisplayBuilderUI that extends JTextField
//The constructor arguments are a Magic constant INT for what type of value it is inspecting, and text describing what should be input
ExpectingField imageField = new ExpectingField(ExpectingField.IMAGE_FILE, "Image");
ExpectingField xField = new ExpectingField(ExpectingField.INTEGER, "X Coordinate");
ExpectingField yField = new ExpectingField(ExpectingField.INTEGER, "Y Coordinate");
ExpectingField width = new ExpectingField(ExpectingField.INTEGER, "Width");
ExpectingField height = new ExpectingField(ExpectingField.INTEGER, "Height");
ExpectingField xRange = new ExpectingField(ExpectingField.INTEGER, "X Range");
ExpectingField yRange = new ExpectingField(ExpectingField.INTEGER, "Y Range");
ExpectingField direction = new ExpectingField(ExpectingField.DIRECTION, "Direction");
ExpectingField reverse = new ExpectingField(ExpectingField.BOOLEAN, "Reverse");

width.setEnabled(false);
height.setEnabled(false);

//fields is a LinkedList of ExpectingFields
//ANALOG, and STICK are constant ints denoting what type of input this is
fields.add(imageField);
fields.add(xField);
fields.add(yField);
fields.add(width);
fields.add(height);
if(inputType == ANALOG) fields.add(direction);
if(inputType == ANALOG) fields.add(reverse);
if(inputType == STICK) fields.add(xRange);
if(inputType == STICK) fields.add(yRange);

Box FieldBox = Box.createHorizontalBox();
Dimension fieldSize = new Dimension(150,20);
for(ExpectingField e : fields){
e.setMaximumSize(fieldSize);
Box currentBox = Box.createVerticalBox();
currentBox.add(new JLabel(e.hintText));
currentBox.add(e);
FieldBox.add(currentBox);
}
customSizeCheckBox.setText("Set custom size");
customSizeCheckBox.setEnabled(true);
Box mainVBox = Box.createVerticalBox();
mainVBox.add(customSizeCheckBox);
mainVBox.add(FieldBox);
mainVBox.add(buttonBox());
promptFrame.add(mainVBox);
promptFrame.setVisible(true); //displays the correctly assembled prompt window
System.out.println("showed window");
currentInput = null; //sets the current input to null because it has not been built yet

try{
currentInput = queue.take();
}catch (InterruptedException e){
Thread.currentThread().interrupt();
}

promptFrame.dispose(); //get rid of the window
promptFrame.removeAll();
fields.clear();
return currentInput; //this will only happen after buildButton has been called
}
public static CustomInput showPromptWindow(String prompt, int inputType, String inputName){
currentInputName = inputName;
JFrame promptFrame = new JFrame();
promptFrame.setTitle(prompt);
promptFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
promptFrame.setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
promptFrame.setLocationRelativeTo(null);

//ExpectingField is a subclass of DisplayBuilderUI that extends JTextField
//The constructor arguments are a Magic constant INT for what type of value it is inspecting, and text describing what should be input
ExpectingField imageField = new ExpectingField(ExpectingField.IMAGE_FILE, "Image");
ExpectingField xField = new ExpectingField(ExpectingField.INTEGER, "X Coordinate");
ExpectingField yField = new ExpectingField(ExpectingField.INTEGER, "Y Coordinate");
ExpectingField width = new ExpectingField(ExpectingField.INTEGER, "Width");
ExpectingField height = new ExpectingField(ExpectingField.INTEGER, "Height");
ExpectingField xRange = new ExpectingField(ExpectingField.INTEGER, "X Range");
ExpectingField yRange = new ExpectingField(ExpectingField.INTEGER, "Y Range");
ExpectingField direction = new ExpectingField(ExpectingField.DIRECTION, "Direction");
ExpectingField reverse = new ExpectingField(ExpectingField.BOOLEAN, "Reverse");

width.setEnabled(false);
height.setEnabled(false);

//fields is a LinkedList of ExpectingFields
//ANALOG, and STICK are constant ints denoting what type of input this is
fields.add(imageField);
fields.add(xField);
fields.add(yField);
fields.add(width);
fields.add(height);
if(inputType == ANALOG) fields.add(direction);
if(inputType == ANALOG) fields.add(reverse);
if(inputType == STICK) fields.add(xRange);
if(inputType == STICK) fields.add(yRange);

Box FieldBox = Box.createHorizontalBox();
Dimension fieldSize = new Dimension(150,20);
for(ExpectingField e : fields){
e.setMaximumSize(fieldSize);
Box currentBox = Box.createVerticalBox();
currentBox.add(new JLabel(e.hintText));
currentBox.add(e);
FieldBox.add(currentBox);
}
customSizeCheckBox.setText("Set custom size");
customSizeCheckBox.setEnabled(true);
Box mainVBox = Box.createVerticalBox();
mainVBox.add(customSizeCheckBox);
mainVBox.add(FieldBox);
mainVBox.add(buttonBox());
promptFrame.add(mainVBox);
promptFrame.setVisible(true); //displays the correctly assembled prompt window
System.out.println("showed window");
currentInput = null; //sets the current input to null because it has not been built yet

try{
currentInput = queue.take();
}catch (InterruptedException e){
Thread.currentThread().interrupt();
}

promptFrame.dispose(); //get rid of the window
promptFrame.removeAll();
fields.clear();
return currentInput; //this will only happen after buildButton has been called
}
The window is generated separately every time because it needs to have different fields depending on the inputType parameter but more specifically, it shows right near the bottom at promptFrame.setVisible(true)
dan1st
dan1st2mo ago
Why does the UI class run take()?
Devin
DevinOP2mo ago
Because it needs the ButtonInput to pass back to main Is there a better way to pass it back??
dan1st
dan1st2mo ago
What do you mean with passing it back? take() waits until there is an element in the queue and removes it once there is one
Devin
DevinOP2mo ago
Correct Main.startBuild calls the method I just shared and expects a CustomInput to be returned. The method has to wait for the user to finish entering the information, once the user clicks the "Done" button, a CustomInput object exists, but it does not exist before the user presses the button, so we need to wait for that to happen. The BlockedQueue is waiting for a CustomInput object to exist before continuing execution, without it the code would immediately try to return null, which is the default value of the object Window opens → We wait for a CustomInput from the queue → User fills all fields → user presses "Done" → We use all the information from the user input to create a CustomInput → we add the CustomInput to the queue → the queue now contains a thing, execution resumes from there. This part actually works correctly, the blockedqueue is doing it's job the problem is that the "Window Opens" step does not show us any of our text fields Even though we've seen it work when I call it from Main.main Is this not a sensible application of the BlockedQueue?
dan1st
dan1st2mo ago
Yeah but showPromptWindow is the UI thing, right? Why would that wait/take something out of the queue? Isn't that supposed to insert stuff?
Devin
DevinOP2mo ago
no Because it isn't a button handler The UI does not make the CustomInput The code makes the CustomInput using information collected from the UI
Devin
DevinOP2mo ago
Like, this is how the button is constructed
No description
Devin
DevinOP2mo ago
What on earth would I be putting into the queue before I have collected the information? Each type of CustomInput will have it's own method that builds it and the user clicking the "Done" button will call the appropriate one I don't know how I could possibly populate the queue without leaving the method that opens the window Since the CustomInput is created between the window being opened and the queue being read from, I literally NEED to have that method on hold while the button is getting created it's the only place in the whole program I CANNOT populate the queue.
Devin
DevinOP2mo ago
I feel like something about this flow would have to be fundamentally different for what you're describing.
No description
Devin
DevinOP2mo ago
Like, would you have the CustomInput constructor send the input directly back to Main via a setter? And if so, would making that change do anything to help me resolve the window issue?
dan1st
dan1st2mo ago
I suggested to make the UI and logic to run in independent threads but I don't really know what the problem is
Devin
DevinOP2mo ago
How do I make them use independent threads? Like, why are they running on the same thread to begin with?
dan1st
dan1st2mo ago
maje the UI not be dependent on the logic Do you really need to return the user input thing from the UI? You only use the blocking queue for sending things from the UI to the logic that was my idea
Devin
DevinOP2mo ago
So like, I have a blocking queue in Main, and the last method in the logic populates that queue?
dan1st
dan1st2mo ago
yes if you want to use two threads Does the UI need anything from the logic?
Devin
DevinOP2mo ago
The UI only needs to know what type of input prompt to display, which is passed in from Main as an int
dan1st
dan1st2mo ago
so the UI doesn't have any reason to take anything out of the queue, right?
Devin
DevinOP2mo ago
I guess, the only reason it does is to return it to the logic immediately so I could just make the prompt return void Hmm the one issue is that I no longer have any way to know when to dismiss the dialog other than making it a field
dan1st
dan1st2mo ago
?
Devin
DevinOP2mo ago
Like, once I get the CustomInput back, I close the input window
dan1st
dan1st2mo ago
Does the method create the CustomInput object?
Devin
DevinOP2mo ago
A different method creates the object I can't close the input dialog from a different method though it's local to the method that displays it
dan1st
dan1st2mo ago
you can put it in the queue and also store it
Devin
DevinOP2mo ago
Alright, I moved the queue back to logic, but still same problem
dan1st
dan1st2mo ago
?
Devin
DevinOP2mo ago
Instead of returning a CustomInput, the promptWindow method returns nothing
No description
dan1st
dan1st2mo ago
ok
Devin
DevinOP2mo ago
Instead I have the button action handler use a setter in Main to offer the input to the queue
Devin
DevinOP2mo ago
No description
Devin
DevinOP2mo ago
here's the setter method And here's my updated while loop, which is now in a try/catch block
Devin
DevinOP2mo ago
No description
Devin
DevinOP2mo ago
but the UI still doesn't render same as in the video I sent of it not working
dan1st
dan1st2mo ago
so the UI isn't responding?
Devin
DevinOP2mo ago
no also my debug case no longer works It either puts every UI element twice in the 2nd prompt or provides a completely empty window which is probably because the logic that cleared out the List of fields and emptied out the frame is no longer delayed until input is received
Devin
DevinOP2mo ago
I have no good place to put these 2 lines anymore
No description
dan1st
dan1st2mo ago
?
JavaBot
JavaBot2mo ago
It looks like you are having issues with debugging or issues that can be solved using a debugger. Check out this article on dev.java to see how debugging works and how to use a debugger. This Stack Overflow question and its answers also explain debugging in general. These links describe how to use the debugger in some IDEs: • Debugging in IntelliJDebugging in Eclipse
dan1st
dan1st2mo ago
if you don't know how to use debuggers
JavaBot
JavaBot2mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Want results from more Discord servers?
Add your server