+ 1
How can i create a javafx gui that reads from a text file and add them to a ui control and how can i use the add and remove btn
Create a JavaFXGUI (Graphical User Interface) application to use the implemented classes as follows:There is a suitable title for the application window.After launching the application immediately, the available workshops should be read from the text file and added to a suitable UI control to select from.It allows registeringand removing attendees, and displaying the whole data. Any confirmation or error message should be displayed on the application (not the standard output).There is a button to clear all UI controls used for entering the data
11 Respostas
+ 3
Hello Mark G. Ghrayeb
How familiar are you with JavaFX? Did you already tried some basic examples like a window with button?
If not, at first you should learn how javafx works. There are many youtube tutorials and you can also look at udemy.
+ 2
Mark G. Ghrayeb
I would try it with tableView:
http://tutorials.jenkov.com/javafx/tableview.html
+ 2
Okay thank you for your help
+ 1
TextArea has a clear() method.
clear.setOnAction(e -> {
ta.clear();
});
And for reading the text file I would write an extra method. Your code will be messy if you put everything into start()
When you open the application you need to read the file? Without an extra button?
In that case you can put readTextFile() into show()
And in your class you write a method readTextFile(){
}
And if I see it right you can use the file reading part from your other class. But you need to replace the print statements in case of errors with alerts.
https://code.makery.ch/blog/javafx-dialogs-official/
0
Yes i will send you my code but i am having dificulty in transferring my code to an event driven programming for examole if i want to add an attendee to a workshop or to remove an attendee
0
Mark G. Ghrayeb
Can you please put your code into code playground. So I can copy it into my ide.
0
Mark G. Ghrayeb
Looks not so bad I would say. I just need a bit more informations.
The TextArea should show the content of your textfile, right?
And clicking on clear button clears the TextArea?
0
Exactly if you want i can send you the question i would be so appreciated if you help me
0
And how can i add attendees when i press add or remove them do you have any idea?
0
Mark G. Ghrayeb
Your welcome. :)