subject
Computers and Technology, 18.09.2019 19:30 goofy44

Using javafx how do i get my datasetbook to run with the following? book: public class book { private string author; private string title; private int pages; public book(string auth, string titl, int pag) { author = auth; title = titl; pages = pag; } @override public string tostring() { return "book [author=" + author + ", title=" + title + ", pages=" + pages + "]"; } public string getauthor() { return author; } public string gettitle() { return title; } public int getpages() { return pages; } @override public boolean equals(object obj) { if (this == obj) return true; if (obj == null) return false; if (getclass() ! = obj. return false; book other = (book) obj; if (author == null) { if (other. author ! = null) return false; } else if (! author. equals(other. author)) return false; if (pages ! = other. pages) return false; if (title == null) { if (other. title ! = null) return false; } else if (! title. equals(other. title)) return false; return true; }}datasetbook: import java. util. arraylist; import java. util. arrays; /*** a simple store for book objects.** @author student**/public class datasetbook extends arraylist { /** * default constructor */ public datasetbook() { } /** * add a book to the store * * @param objtoadd * * @return true if the element was added to the collection, false otherwise */ public boolean add(book objtoadd) { return super. add(objtoadd); } /** * the number of books currently in the store * * @return number of book objects */ public int size() { return super. size(); } /** * determine the book with the fewest pages * * @return null if the store is empty. the book with the fewest pages * otherwise. if more than one book has the fewest number of pages, * the first one is returned. */ public book getmin() { if (super. { return null; } book mele = super. get(0); for (int i = 1; i < super. size(); i++) { if (mele. getpages() > (super. get(i). { mele = super. get(i); } } return mele; } /** * determine the book with the most pages * * @return null if the store is empty. the book with the most pages * otherwise. if more than one book has the most number of pages, * the first one is returned. */ public book getmax() { if (super. { return null; } book mele = super. get(0); for (int i = 1; i < super. size(); i++) { if (mele. getpages() < (super. get(i). { mele = super. get(i); } } return mele; } /** * a string representation of the store. * * @return a string containing the number of books in the store, * the minimum book, the largest book, and * the contents of the entire store. */ @override public string tostring() { return "datasetbook [\n size()=" + size() + "\n getmin()=" + getmin() + " getmax()=" + getmax() + " books=\n" + arrays. tostring(super. + "]"; } }import javafx. application. application; import javafx. event. actionevent; import javafx. event. eventhandler; import javafx. geometry. pos; import javafx. scene. scene; import javafx. scene. control. button; import javafx. scene. control. label; import javafx. scene. control. textfield; import javafx. scene. layout. stackpane; import javafx. scene. layout. vbox; import javafx. scene. layout. hbox; import javafx. scene. layout. pane; import javafx. scene. layout. borderpane; import javafx. scene. paint. color; import javafx. scene. text. text; import javafx. stage. stage; public class handler extends application{ public void start(stage stage) { label author= new label("author"); //creating labels and textfields textfield textfield= new textfield(); label title= new label("title"); textfield textfield2= new textfield(); label pages= new label("pages"); textfield textfield3= new textfield(); button button= new button("make a new book"); //creating button button. setalignment(pos. top_right); hbox hb = new hbox(); hb.(author, textfield, title, textfield2, pages, textfield3, button); hb. setspacing(10); borderpane borderpane= new borderpane(); borderpane. settop(hb); borderpane. setalignment(hb, pos. top_center); scene scene= new scene(borderpane, 800, 500); stage. settitle("a simple book store"); stage. setscene(scene); stage. show(); }}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:00
Aisha has finished working on a word processing document that contains 15 pages. she has added some special elements in the first three pages, page 9 and 10, and page 15 from the document. she wants to print only these pages to see how they look. which option is the correct way to represent (in the print dialog box) the pages that aisha wants to print?
Answers: 1
question
Computers and Technology, 24.06.2019 07:00
Why would a business likely use a java applet - to back up their data files for the business - to create a program that a customer can launch in their web browser - to create music on a powerpoint presentation - to organize files on their company directory
Answers: 3
question
Computers and Technology, 24.06.2019 10:00
3. what do the terms multipotentialite, polymath, or scanner mean?
Answers: 2
question
Computers and Technology, 24.06.2019 11:00
Need fast im timed in a paragraph of 125 words, explain at least three ways that engineers explore possible solutions in their projects.
Answers: 2
You know the right answer?
Using javafx how do i get my datasetbook to run with the following? book: public class book { privat...
Questions
question
Mathematics, 13.09.2020 14:01
question
Mathematics, 13.09.2020 14:01
question
Mathematics, 13.09.2020 14:01
question
Mathematics, 13.09.2020 14:01
question
Mathematics, 13.09.2020 14:01
question
History, 13.09.2020 14:01
question
Mathematics, 13.09.2020 14:01
question
Mathematics, 13.09.2020 14:01
question
Mathematics, 13.09.2020 14:01
question
Mathematics, 13.09.2020 14:01
question
Social Studies, 13.09.2020 14:01
question
Mathematics, 13.09.2020 14:01
question
History, 13.09.2020 14:01
question
Mathematics, 13.09.2020 14:01
question
Social Studies, 13.09.2020 14:01
question
Mathematics, 13.09.2020 14:01
question
Mathematics, 13.09.2020 14:01
question
Mathematics, 13.09.2020 14:01
question
Mathematics, 13.09.2020 14:01
question
Mathematics, 13.09.2020 14:01
Questions on the website: 13722361