data from jTextfield and display to the jTable and textfile - netbeans-7

i need help , im a Java newbie. i have a table and has a 3 Columns ID , Name , Age. Every Data inputted at the jTextfield will Display to the Table. The data Display in the Table will also Display at the Textfiles.

You might want to use DefaultTableModel if you want to populate your table. Create an array of your inputs and simply add to your table.
DefaultTableModel dtm = (DefaultTableModel) jTable1.getModel();
String a[] ={jTextField1.getText(),jTextField2.getText(),jTextField3.getText()};
dtm.addRow(a);

Related

how to get the data from a column based on name not the index number

I have a dataframe with column abc having values like below
[{note=Part 3 of 4; Total = $11,000, cost=2750, startDate=2021-11-01T05:00:00Z+0000}]
Now I want to extract data based on name,for example i want to extract cost and start date and create a new column.
Asking it to be working on name because the order of these values might change.
I have tried below line of code but due to change in the data order I am getting wrong data.
df_mod = df_mod.withColumn('cost', split(df_mod['costs'], ',').getItem(1)) \
.withColumn('costStartdate', split(df_mod['costs'], ',').getItem(2))
That's because your data is not comma-separated, it just looks like that. You'll want to use regexp_extract to find the correct content.

how to calculate the difference between the sum of each column from different datagridview and to show it in a datagridview

Hello I am a student in computer science , we ve got a inventory system project to do.
I have a problem
using sql I know how to importe sql to datagridview. I know have to save data in sql database using vb
but I still don t know how to calculate the difference of sum of each column from each different datagridview and to show it in datagridview.
My gol is:
I have a datagridview1 that shows the quantity of purchsases of a product in column A.and I have another datagridview2 that shows the quantity of sells of the same product in column B.
Datagridview1 is on form1.vb.
datagridview is on form2.vb0
what I want is : to calculate and view the stock the stock still available on new form3.vb on datagridview3.
thanks in advance
You need to follow the following steps (For selected Row):
Dim Data1 As String = GridView1.SelectedRow.Cells(Column Number).Text
Dim Data2 As String = GridView2.SelectedRow.Cells(Column Number).Text
Data1 - Data2
Save the result in a new table (database)
Show the new gridview3
Repeat for all rows.

only get numberic value in qlikview

i have this kind of data
-
B-3-I11
B-3-I12
BI1-I190
BI1-I191
BI1-I192L
BI1-I194A
BI1-I195L
BI1-I198R
BI1-I199L
BI1-I200Ac
BI1-I201L
conasde
Installation
Madqw
Medsfg
Woasd
this is the data I have .. now I want only those which start from B and have some numeric character in data..how I get in qlikview script
how to extract only those data ..
To filter to those that start with B you'd do
where left(Field,1)=B
Then to filter on those with numbers, you could add
and len(keepchar(Field,'1234567890'))>0
So that would give something like this:
LOAD Field
From Table
Where left(Field,1)=B
AND len(keepchar(Field,'1234567890'))>0
(where Field is the name of the field your data is in and Table is the name of the table your data is in)
Or, if you want to keep all the data but create a new field you would do:
LOAD
Field,
if(left(Field,1)=B AND len(keepchar(Field,'1234567890'))>0`,Field) as FieldFiltered
From Table

ADD static table in Dax

Dears
i tried to show data in power BI using a variable inside a measure but can not show more than one value.
Dax code :
Measure Not Worked : NewTable = var Data = DATATABLE("SES",STRING,{{"Name1"},{"Name2"}}) return Data
Measure Worked : NewTable = var Data = DATATABLE("SES",STRING,{{"Name1"}}) return Data
Message error : a table of multiple values was supplied where a single value was expected .
Thanks, best regards.
A measure must return a single value, not a table. (You can use tables inside of a measure though.)
If you want a static calculated table, enter it as a New Table under the Modeling tab, instead of a measure.
NewTable = DATATABLE("SES",STRING,{{"Name1"},{"Name2"}})

vb if condition on items and price from database

I actually have a Access database where i have a table called "tblfreight" and two column is there (items and Price)
And I want to auto show the Price when I choose Items.
There is two Textbox: "txtitems" and "txtprice"
I want to be like this....
If txtitems.text = select from tblfreight and column items Then
txtprice.text = select from tblfreight and column Price
Else txtprice.text=0 (Zero)
You need to query your DB first..
Select * from tblfreight - will get you your data you need.
Then you need to put this data somewhere. You can use a combobox for this. Once you have your combobox filled with your data you then can set the price into a label or textbox easily.
You can use the combobox selected index changed event...
Inside the changed event something like this would work...
textprice.text = Combobox.selecteditem.value
This will give you a great start, that's why this answer just gives you the steps and not the full code.