Save JRadioButton Text in to database 1 Answer(s) 3 years and 2 months ago
Posted in : Java Beginners
Hello Sir I have Two JaradioButtons 1)Semwise Course 2)Yearwise Course I want To Save Text from JRadioBuuton in to Access Databse and Access Databse. with user can select any one option from that two RadioButtons. plz Help Me Sir.
public static void main(String[] args) throws Exception{ SwingFrame sf=new SwingFrame(); } public SwingFrame(){ JFrame f = new JFrame("Frame in Java Swing"); f.getContentPane().setLayout(null); JLabel lbl1 = new JLabel("Course"); text=new JTextField(15); final JRadioButton c1,c2; ButtonGroup radioGroup=new ButtonGroup(); c1=new JRadioButton("Semwise Course"); radioGroup.add(c1); c2=new JRadioButton("Yearwise Course"); radioGroup.add(c2); JButton button=new JButton("Submit"); text=new JTextField(15); c1.addActionListener(al); c2.addActionListener(al); lbl1.setBounds(50,50,70,30); button.setBounds(50,80,100,30); c1.setBounds(110,50,200,30); c2.setBounds(310,50,200,30); text.setBounds(110,80,100,30); text.setVisible(false);
button.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ if((c1.isSelected()==false)&&(c2.isSelected()==false)){ JOptionPane.showMessageDialog(null,"Please select radio button"); } else{ String g=text.getText();
try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection("jdbc:odbc:access"); PreparedStatement st=con.prepareStatement("insert into names(ctype) values(?)"); st.setString(1,g); int i=st.executeUpdate(); JOptionPane.showMessageDialog(null,"Data is successfully inserted into database."); } catch(Exception ex){} } } });
f.add(lbl1); f.add(c1); f.add(c2); f.add(button); f.add(text); f.setSize(500,500); f.setVisible(true); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } private ActionListener al = new ActionListener() { public void actionPerformed(ActionEvent e) { text.setText(((JRadioButton) e.getSource()).getText()); } }; }
Thanks
Related Pages:
Save JRadioButton Text in to database - Java Beginners SaveJRadioButtonText in to database Hello Sir I have Two JaradioButtons
1)Semwise Course
2)Yearwise Course
I want To SaveText from... java.awt.*;
import java.awt.event.*;
public class SwingFrame{
JTextField text
Problem with JRadioButton and Access Database - Java Beginners
Problem with JRadioButton and Access Database Hello sir ,Here I have write following code to savetext on JradioButton but this is not saved in Access Databse,
I want to store course type in to database and also other fields
Text field save as word file Text field save as word file Dear experts At run how to save set of text field contains text into single Word file. To save in our desktop computer. Solve my problem
save text file - Java Beginners savetext file hi
i have just start programming in java.please guide me if i want to read a text file in java.then the text file is save in which directory
save output in multiple text files save output in multiple text files Hi..I'm getting problem to store the output of this php code into multiple text files. Can anyone sugeest.
Here is my code:
<?php
for($i=1; $i<=100; $i++)
{
$html = file_get
what is proper way to save pictures in SQl database and call it through JSP ?
what is proper way to save pictures in SQl database and call it through JSP... 'getContextPath()' mehtod using this method I can call pictures and Text on same... type i can't see text on same page.
Please tell me proper way to do
save multiple records into database using jsp/servlet mvc save multiple records into database using jsp/servlet mvc hai,
this is my jsp where i have enter multiple username and password and save it to database in single hit
user.jsp
<form action="UserServlet" method="post
SQL database parameters should save at where?
SQL database parameters should save at where? Hi,
Currently... the script will be running for very long time,
I like to move the SQL database..., if there is a database changed (hostname, username or password)
It should
Save Table - SQL Save Table Where Oracle Tables or Database is saved?
How to see Oracle Tables ?
What are the websites to learn step by step Oracle.
Help Me
how to save uploaded image in database using javascript
how to save uploaded image in database using javascript Please can you tell me how to store uploaded image in database using java I'll use...;
Now i want to store it on database...
Please help me
Thanks in Advance
code save word file in 10g database - SQL
code save word file in 10g database I am not having any idea to save the whole word document in Oracle 10g. Please help me. Hi Friend,
Try the following code:
import java.io.*;
import java.sql.*;
public
Insert image from user using and save in database
Insert image from user using and save in database when i am trying to upload a image from user and trying to save into oracle9i database....
Apache Tomcat/6.0.29 We have used MySQl database.
1)page.jsp:
<
save switch data into database - Java Beginners save switch data into database switch(menu) {
case 1://add a student
System.out.print("Enter student ID: ");
int ID = scan.nextInt();
System.out.print("Enter your name: ");
String name = scan.next();
break
image save to folder in java
image save to folder in java Hi,
I am working with java. In my application i want to give facility to user to add and change image. I use open... folder and that path stored into database, for furhter retrivation.
Please guide me
uploading a text file into a database
uploading a text file into a database how to upload a text file into a database using jchooser
import java.io.*;
import java.sql....: ");
final JTextField text=new JTextField(20);
JButton b1=new JButton
How i upload file and save that record in database using JSP?
How i upload file and save that record in database using JSP? Hi All,
I m the beginner in JSP and I want to upload the file and store that file and some other form data in MySQL database.
Ex. There is one employee detail form
database
database dateofbirth is not save into the database while i am enter from html browser.it shows as null.whats the reason
How to save excel sheet into mysql database using blob or clob
How to save excel sheet into mysql database using blob or clob Hi All,
I am new to java and i need to upload excel sheet to mysql,
please suggest me the steps to do this, i am able to connect to the database, from there i don't
How to save run time created text-file on a disk using jsp/servlet?
How to save run time created text-file on a disk using jsp/servlet? I have a JSP page with save button.In that I created the file(e.g a.txt) at run-time,when I click on the save button,it will ask where to save the file
Java save file to database
Java save file to database
In this section, you will learn how to insert file to database.
Description of code:
Firstly, we need to establish a connection between MySql database and java
file with the help of various types of APIs
Full path of image to save it in a folder
Full path of image to save it in a folder Sir ,I am trying to upload.... saving the file uploaded into the database, which would require the use... if you wish to store files in database
Class.forName("sun.jdbc.odbc.Driver
Export Database table to CSV File
Export Database table to CSV File
In this tutorial, you will learn how to retrieve data from database and save
it to CSV File.
The Comma-separated values... a normal
text file, and save the fetched data to it. There is no need to use any
Database
then automatically save that subjects in my database
for this i want procedure some
To save table format data in pdf/excel in jsp
To save table format data in pdf/excel in jsp Hello,
I am doing web application project in jsp. In webform ,I am displaying database data in html table. So my question is ,I want so save this html format data in pdf/excel format
Database
page then it automatically save into MySQL.but i am not create the table
DATABASE
DATABASE how to store data into database using JDBC & SQL
 ... JTextField text=new JTextField(20);
final JTextArea area=new JTextArea(5,20...){}
}
});
f.add(lab1);
f.add(text);
f.add(lab2
Which extension i use for save hibernate file.
Which extension i use for save hibernate file. Please give me answer that which extension i use for save the hibernate file and how i run that file... the class object to the database table. Another is the hibernate configuration file
database
database i am created one table in mysql database with one... or not. If it is already exist in database, then show a message 'Already exists...:
<html>
<head>
<script type="text/javascript">
function check
HOW TO SAVE XML INTO MYSQL AND RETRIEVE IT USING JAVA
HOW TO SAVE XML INTO MYSQL AND RETRIEVE IT USING JAVA H ello, i have an xml code, i need to save it into mysql 5.5 server database using java. i also want to be able to retrieve it as well. please note that i want it saved
save links clicked in search engine results
,if i click on a link.i also need to save the clicked link to a database or file.i...save links clicked in search engine results hello
i need to access...;
But i'm not able to find how to save the links the user clicks.hope you
DATABASE
DATABASE you need to create two tables: country(countryid Number,countryname text) and state(stateid Number countryid Number, statename text);
1...;head>
<script language="javascript" type="text/javascript">
Question about "Insert text file data into Database"
Question about "Insert text file data into Database" Hey
I was reading the tutorial "Insert text file data into Database", (awesome btw), and noticed that both a FileInputStream, a DataInputStream and a BufferedReader
Database
final String CONTEXT="text/html";
}
It seems that you forget
How to save image after edit in php
How to save image after edit in php Hello,
I have create a simple...;script src="pixastic.core.js" type="text/javascript"></script>
<script src="actions/desaturate.js" type="text/javascript"></script>
<
fetch values from database into text field
fetch values from database into text field please provide the example for fetching values from database into text field of table
wth edit...;");
out.println("<td><input type=\"text\" name=\"LASTNAME\" value
fetch values from database into text field
fetch values from database into text field please provide the example for fetching values from database into text field of table
as if i am... type=\"text\" name=\"LASTNAME\" value=\"rs.getString(2)"></td>