Suppose the program is modified and a ProductDetails frame (in JavaFX/Java Swing) is added to the same application. Assume all components are added to the frame (ProductDetails) and event registration on jc (JComboBox) and jb (JButon) has been done. You are required to write an inner class (ProductDetailsHandler) to handle the events on the JComboBox and JButton. Upon selecting the type of the products from jc (CountedProduct, WightedProduct, Both), the application reads the products details from the file using readProduct() method corresponding to the selected product type and displays the details of each to the console. In case if the CheckBox ‘cb’ is checked, it takes the product ID from the user in ‘jt’ (JTextField) and upon pressing the ‘jb’ JButton, the details related to the product are retrieved from the file if it is CountedProduct only and displays on the console otherwise it displays a message to the user “Select Counted Products”. Assume all componenets objects are accessible in readProduct() method.
You don't need to make whole frame. Just give code snippets of asked things.
Java
Suppose the program is modified and a ProductDetails frame (in JavaFX/Java Swing) is added to the same application. Assume all components are added to the frame (ProductDetails) and event registration on jc (JComboBox) and jb (JButon) has been done. You are required to write an inner class (ProductDetailsHandler) to handle the events on the JComboBox and JButton. Upon selecting the type of the products from jc (CountedProduct, WightedProduct, Both), the application reads the products details from the file using readProduct() method corresponding to the selected product type and displays the details of each to the console. In case if the CheckBox ‘cb’ is checked, it takes the product ID from the user in ‘jt’ (JTextField) and upon pressing the ‘jb’ JButton, the details related to the product are retrieved from the file if it is CountedProduct only and displays on the console otherwise it displays a message to the user “Select Counted Products”. Assume all componenets objects are accessible in readProduct() method.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images