(with GUI) developed with Java programming language.Use NetBeans Application.
Create a project named “FavoriteBooks” which keeps a list of the books that a user has read and liked.
Book id, Title, Category, First Author Name and Surname, Award Winner, Rating, Year, Number of Pages, and Short Description.
Functions:
1. Add a Book to the list with the given book id from a JTextField.
a) Data to be entered using JTextField components are: Title, Category, Author Name and Surname, Award Winner, Rating, Year, Number of Pages and short Description. This task should add the book to the text document.
b) Rating option can be selected from a JComboBox.
c) JTextArea can be used to enter a short description of the book.
d) Do not create a JTextField to enter the book id. Instead, the book id should be incremented automatically by checking the last book id in the text document.
import java.awt.event.*;
import javax.swing.*;
class Main extends JFrame implements ActionListener {
static JTextField tf;
static JFrame fm;
static JButton bn;
static JLabel ln;
public static void main(String[] args)
{
f = new JFrame("Application");
b = new JButton("submit");
Main te = new Main();
t = new JTextField(16);
JPanel p = new JPanel();
p.add(t);
p.add(b);
p.add(l);
f.add(p);
f.setSize(300, 300);
f.show();
}
Comments
Leave a comment