d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Java Gui Problem
Add Reply New Topic New Poll
Member
Posts: 24,101
Joined: Nov 8 2007
Gold: 5,561.70
Jun 13 2012 01:33pm
I'm trying to convert whatever is written into the JTextField to a double, so I can use it in another class in an equation.

Trouble is I'm having trouble converting it, I know pasreDouble will convert a string but I have JTextField not a string =/

I created a JTextField as follows:

Code

int principalTextFieldLength = 10;
principalTextField = new JTextField(principalTextFieldLength);
principalTextField.setText("0.0");
add(principalTextField);
Member
Posts: 24,101
Joined: Nov 8 2007
Gold: 5,561.70
Jun 13 2012 01:55pm
Solved it nvm lol, stupid problem.

This post was edited by lopelurag on Jun 13 2012 02:09pm
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll