Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Java 

Sorting Algoritm DrawString Problems

Hello,

Just started my journey learning programming languages and i am kinda stuck on 1 part of the book.

The problem : I have to create a GUI with JPanel/JFrame with 3 JTextFields and 1 button.
With this i have to make sure that whatever number i fill in to those JTextFields get to be sorted from highest to lowest by drawString output underneath the JTextFields.
Could anyone help me out understand this piece of code so that i could use these things in the right context and figure out how to make the program print out those values in the right order.

Thank you for helping!


bumperrrrrr bumperrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr


bumperrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
[Image: onoNUGi.gif]
Well what have you tried so far?
In short, take the input and compare it to any existing numbers and then show the sorted numbers. Which part are you stuck on?
I wouldn't focus on the GUI part of coding for right now.
Never heard of drawString, but you can just use setText() method to set the text in the right order after pressing the button. So you have to add an eventlistener when the button is pressed and the parse Integers out of the textfields string output and then put them in the right order. Maybe but the numbers into a list and sort it and then output it to the textfield. But like Sheeple said you should stick to the console programming. I promise you that its way better to get started to code just by making the console applications. I just finished one course which was 14 weeks long. Never coded java before. And after 11 weeks i got only touch with the gui stuff. I still prefer console applications over GUI ones.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by lucienhfMar 22, 2024 03:06 AM 4 241 Mar 22, 2024 03:06 AM
Last Post: lucienhf
[Python] by ThisBearScatJan 27, 2020 06:27 PM 16 341 Jan 27, 2020 06:27 PM
Last Post: Lindros
[.NET] by JavaJaneMay 29, 2019 08:26 AM 1 185 May 29, 2019 08:26 AM
Last Post: tweety