guibook | 『入門 GUI(以下、GUI 本)』の第 2 章のサンプルコードです(同人版よりも内容的には進んでいますのでご了承ください) | User Interface library
kandi X-RAY | guibook Summary
kandi X-RAY | guibook Summary
『入門 GUI(以下、GUI 本)』の第 2 章のサンプルコードです(同人版よりも内容的には進んでいますのでご了承ください)
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of guibook
guibook Key Features
guibook Examples and Code Snippets
Community Discussions
Trending Discussions on guibook
QUESTION
I am totally new to java, have only started a few weeks ago. I have an assignment that has to be complete soon. The assignment states that i have to create a JAVA application for a book shop that allows a user to perform database operations using an appropriate GUI.
This project must have 3 classes. one for GETTERS AND SETTERS another for the GUI elements and finally one for the SQL DATABASE PREPARED STATEMENTS.
in advance, i apologies for what is probably bad code quality.
My problem seems to be, that when i run the project and try to update or insert or delete , that it never works, instead the JOPtionPane "Data is not saved" pops up instead.
I would really appreciate any help , tips , advise . the code for my project is as follows:
BOOK CLASS ( GETTERS AND SETTERS) :
...ANSWER
Answered 2017-Jul-12 at 10:16Firstly you should make the variables in the 'Book' class private. Encapsulation is a key OOP concept.
You could try naming the database columns explicitly in your insert statement too e.g.:
String query = " insert into users (first_name, last_name, date_created, is_admin, num_points) values (?, ?, ?, ?, ?)";
Secondly in the guiBook (should be GuiBook or GUIBook class names should start with a capital letter) i would make use of the Book class you created. Create a book object from the values you get from the text fields and pass it to your 'insert' method.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install guibook
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page