I am making text based operating system in java and i am wondering if i should use threads. It has a GUI but you type commands and press a button to enter them. Then it spits back out text in a textArea. When should i use threads and how do i use them? Do i need to use threads? I don't really know how to use them and when to use them!
Should I use threads when making a text based operating system in java?
158 Views Asked by mrspy1100 At
1
There are 1 best solutions below
Related Questions in JAVA
- Add image to JCheckBoxMenuItem
- How to access invisible Unordered List element with Selenium WebDriver using Java
- Inheritance in Java, apparent type vs actual type
- Java catch the ball Game
- Access objects variable & method by name
- GridBagLayout is displaying JTextField and JTextArea as short, vertical lines
- Perform a task each interval
- Compound classes stored in an array are not accessible in selenium java
- How to avoid concurrent access to a resource?
- Why does processing goes slower on implementing try catch block in java?
- Redirect inside java interceptor
- Push toolbar content below statusbar
- Animation in Java on top of JPanel
- JPA - How to query with a LIKE operator in combination with an AttributeConverter
- Java Assign a Value to an array cell
Related Questions in MULTITHREADING
- new thread blocks main thread
- WPF MessageBox Cancel checkbox check
- How to avoid concurrent access to a resource?
- run oncomplete event in async
- Threading Segfault when reading members
- Function timeouts in C and thread
- How are multiple requests to Task.Run handled from a resource management standpoint?
- Acumatica perfomance with threads
- Wait and Notify in Java threads for a given interval
- Different behavior of async with Visual Studio 2013(Windows8.1) and GCC 4.9(Ubuntu14.10)
- How to return blocking queue to the right object?
- background thread using Task.Run
- deletion and cleanup of worker thread in Qt crashes
- Pipeline-like operation using TChan
- implementing in app purchase on android
Related Questions in TEXT-BASED
- Text chat only in TokBox?
- Monodevelop C# user input
- How to do scheduled tasks in ASP.NET?
- How to remove dictionary entry depending on item condition
- How to code item interaction in text adventure
- How can I create a text based game like Zork in PHP?
- HTML buttons showing text without interrupting the script
- Code duplication java object in two classes
- Why is my global variable not working? (Python)
- How do I repeat a choice in an Else/if format on Python?
- User/Player Health is not saved during attack simulation using a coin and random
- How can I wait for an input while something else happens at the same time?
- How do I create an account to store information?
- Custom "invalid input" error message in Text-Based Game
- Python text game launches but wont allow me to move through rooms
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Use threads when you don't want the GUI to lock up. For instance, if you have (or foresee) a "cancel ongoing operation that seems to be stuck" button, then that operation better be going on in a separate thread or else your cancel button will be part of what's stuck.
Also, in some environments (e.g., smart phones), if the GUI of a Java program locks up, the operating system will kill the program.
To learn about threads in Java, take a look at the Concurrency tutorials.