Hi I'm new to GUI. Ive created a calculator but i dont know how to get the number from the textfield and calculate the answer. Can u suggest ways i can do this. Thankyou.

Use getText() inherited from TextComponent or toString() inherited from Component parse it to appropriate type and calculate.
option 2 create new class NumerictextField that extends TextField, with some method called getValue that will return appropriate numeric value or throw exception of wrong input type

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.