This is my GUI diagram

book --> reservation --> payment

  • I need to know what should i add if i wan to take total value from "book" class to use at "payment" class. help me TQ
public book () { 
double price = 12.00;

Im using passing value to show the result at "reservation". so i have to convert that data type into String.

double change = 0.0;
	 				double deposit = (Integer.parseInt(jtfDeposit.getText().trim()));
	 				double total;
    				change = deposit - total;
   					jlbChange1.setText(" Total : RM" + change+"0");

if i compile, it will display "variable total might not been initialized". I dont want to set any value for total coz i have many booking class with different total value.

Recommended Answers

All 3 Replies

declare that same as another varible f.e. chage

can u explain more?

double total = 0.0;

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.