|
Create a Bezier class (inheriting from an abstract Shape ), which holds all three co-ordinates. You can then build a collection of Bezier objects and create your graphics from that. The tutorial link I provided in my first response gives examples that you can easily build on.
Veni, vidi, abiit domum
|
|
|
|
|
Thanks for helping but where are those examples ? can you send me the link for a particular example same my problem ?
|
|
|
|
|
I gave you a link to the tutorials on Collection classes in my previous answer.
Veni, vidi, abiit domum
|
|
|
|
|
|
|
Hello every one...I am student of mtech form RK university rajkot,
and my dissertation topic is on web spamlink detection,
so if any body have a source code to detect web spam link
please mail me....
thanks in advance
|
|
|
|
|
Please do not post the same question in multiple forums
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
What I want to do is,when ever I click on any Item selected in the Combo Box it should display the result accordingly.
My code does that ,but I wanted to know is there any way that I don't use lots of IF statements?Right now it is according to Index of combo box items.
else if(e.getSource().equals(jcb1))
{
int selectedindex = jcb1.getSelectedIndex();
String comb_string = (String)jcb1.getSelectedItem();
if(selectedindex==1)
{
try {
String sql_command ="select * from Employer where Employername = ? ";
PreparedStatement st=con.prepareStatement(sql_command);
st.setString(1,comb_string);
Result = st.executeQuery();
int test =0;
String Store="";
String Response ="";
test++;
if(Result.next())
{
String add1=Result.getString(3);
first.setText(add1);
String add2=Result.getString(28);
second.setText(add2);
String add3=Result.getString(4);
third.setText(add3);
String add4=Result.getString(6);
fourth.setText(add4);
if(test !=0)
{
Response = "Number of Records that Matches :"+test+Store;
JOptionPane.showMessageDialog(null, Response);
}
else
{
JOptionPane.showMessageDialog(null,"Could not be found");
}
}
} catch (SQLException e1) {
e1.printStackTrace();
}
}
}
EDIT:
I think
if(jcb1.getSelectedItem().equals(comb_string))
this is the solution.
I have a JTextField instead ,but what this code does is ,it adds the name which I search into JComboBox and remembers it till the JFrame is open.
|
|
|
|
|
I want to implement chat room in jsp. Plz help me
|
|
|
|
|
Help you with what? If you think someone is going to write the code for you then I'm afraid you are in the wrong forum. Since chat room software seems to be the commonest project for new developers I suggest you try a Google search for samples and articles.
Veni, vidi, abiit domum
|
|
|
|
|
sushilshukla wrote: Plz help me
1. Decide what the application will do, specifically how the user will interact with it (what they will 'see' and what they 'do')
2. Learn the basics of a programming language
3. Learn the basics of network protocols.
4. Learn how to program network communication in the language you are using.
5. Learn how to interact with the user in the language.
6. Put all of the above together to create an application
7. Test 6, and fix problems until it works meeting the goals of 1.
|
|
|
|
|
|
Here is the code I tried to add up all values of JTable column but not working properly!
int row =jTable1.getRowCount();
int sum=0;
for (int i = 0; i < row; i++){
sum+= Integer.parseInt(jTable1.getValueAt(i, 5).toString());
}
String totalResult = Integer.toString(sum);
txtTotal.setText(totalResult);
The values to add up are in 5th column! Thanks!!!
-- modified 23-Nov-13 4:01am.
|
|
|
|
|
Cyber12 wrote: but not working properly! Well I have Googled that, but didn't find anything; maybe you could try explaining what it means.
sum+= Integer.parseInt(jTable1.getValueAt(i, 5).toString());
Why are you converting a value to a string just so you can parse it back to a value?
Veni, vidi, abiit domum
|
|
|
|
|
Because the syntax didn't allow me to write without converting to string! Can fix it removing the .toString(); if it is possible!!!
Or I need an other alternative code if possible? Thanks!
|
|
|
|
|
Well you neeed to figure it out based on what object type is held in that cell.
Veni, vidi, abiit domum
|
|
|
|
|
The type of object held in that cell(column) is integer or double.
Thanks!!!
|
|
|
|
|
So all you need to do is add them all together, right? You really need to think a bit more about exactly what you are trying to do here, and explain it in proper detail. Telling us that a column can hold an integer or real number is not particualrly useful, as it tells us nothing about what your actual problem is.
Veni, vidi, abiit domum
|
|
|
|
|
I have Tested the code to add up all double values in one column! And The Error is: java.lang.NullPointerException, Pointing to the the line of code: sum+=Double.parseDouble(tblviewTaxDetails.getValueAt(i,5).toString());
Please help modifying it!!! Thanks!!
|
|
|
|
|
Cyber12 wrote: The Error is: java.lang.NullPointerException Which means that you are tring to refer to an item by an invalid reference. You should try to break the offending statement into its constituent parts and then use your debugger to find out why you have a NULL pointer in there. In the above case something like:
Double dblValue = tblviewTaxDetails.getValueAt(i,5);
sum += dblValue;
Understanding what NullPointerException s are, what can cause them and how to avoid them, will make your life considerably easier.
Veni, vidi, abiit domum
|
|
|
|
|
Thanks!!! Problem Solved!!! It was because of the number of rows in the JTable!!!! It must be equal to the number of values to be summed up!!! My JTable initially had 100 rows, I tried it adjusting the number of rows equal to the number of records displayed in the JTable! It's now working properly! Thanks!
|
|
|
|
|
What will be the default value of indexes when i create
char[] ch = new char[50];
|
|
|
|
|
What indexes are you talking about?
Veni, vidi, abiit domum
|
|
|
|
|
such as index ch[5] ... i just want to know is null="" ???
|
|
|
|
|
What happens when you try it, or use your debugger to check?
Veni, vidi, abiit domum
|
|
|
|