fetch

Java prog#9. Get value from JTable and set it to jtextfield in Netbeans Java and Sqlite (mysql)



Sharing buttons:

hello guys today I am gonna show you how

to make the J table click to do

different things for example if you

click anywhere in the table so all the

data if you want in these text boxes so

how can we do that I will show you today

first of all just drag text boxes and

give them a level which I have already

shown you previously then right click on

the table go to event and go to mouse

and mouse click

you will automatically go to the saw

spindle here then we will make a quick

walk first

breakage

exception e

and just right the option paint not so

messy Dalembert null comma E now and try

block

first of all declare a variable int int

Rho is equal to whatever is your table

name our table name is table employee

sequel to death will employ don't

select intro

then legally on a string string

mmm consider the spring in anything then

it is table click

is equal to

in the brackets table name

don't

do

don't

get

when we went

and in the when you went right row which

is this variable and here right

zero I'm taking zero because I want to

consider employee ID or zeroth component

of the table then not to string because

you considered as data string now

as usual right PhD cannot prepare

statement

and here

might be a state-owned home dot prepare

statement or forgot to write very first

so I enter query string Q is equal to

select star from our table name which is

employee info

paint

we're employer ID is equal to which is

this employee ID name is equal to a

string variable name which is table

click just paste it here

select star from employee ID when boy I

taken employee info they employ ID is

equal to a variable string then right

prepare statement is equal to corn the

problem statement SQL and RS annual PSD

dot insecure query invited him

statements

in this statement it is dot next

let's talk next

consider any string string I got the

celeries and 1 and 1 equal to dot dot

get string

looks right

the name of one of these columns right

now we want to employ ID name surname

and age so one by one we will write in

the box

first of all employee ID

1880

and you want this employee ID into this

text field copy the name of the text

field and paste it here dot set text is

equal to add one which we have taken

here

so for all four text field we have to do

like same copy pasting three times three

and change the variable add 2 & 3 also

all right and we have to change this

text field and to make these names so

funny my variable name is text names or

replace this name is texting then what

will my name is text server will place

it here just solely my both field name

is text age replace it here text age

and here you want to show take data from

data tables so named called names

I think and let's see column names are

my ID name surname and age name surname

and which

we have written this code as trying to

run it

we won the program

okay it says no such column called

employee ID okay so I have to check

check my column name what is my column

my column name is in instead of employee

ID I by mistake I've taken the column

name employee ID EMP Oh Y double e ID so

I have to change the spelling here yeah

and also here now let's try to run the

program

and when you click

this table it shows two data once again

link the table

it shows the data

so this was the simple tutorial to use

Jacob will click and show the data into

the text field thanks for now on

watching and please rate comment and

subscribe bye