Javaprojectcode
Javaprojectcode
if (input.isEmpty()){
else{
try{
txtk.setText("" + kelvin);
txtf.setText("" + fahrenheit);
catch (NumberFormatException e) {
}
String input = txtk.getText();
if (input.isEmpty()){
else{
try{
txtc.setText("" + celsius);
txtf.setText("" + fahrenheit);
catch (NumberFormatException e) {
if (input.isEmpty()){
else{
try{
txtc.setText("" + celsius);
txtk.setText("" + kelvin);
}
catch (NumberFormatException e) {
Weight code
if (input.isEmpty()){
} else try {
double mg = Double.parseDouble(txtmg.getText());
double g = mg * 0.001;
double kl = mg * 0.000001;
txtg.setText("" + g);
txtkg.setText(""+kl);
txtt.setText(""+ton);
} catch (Exception e) {
if (input.isEmpty()){
} else try {
double g = Double.parseDouble(txtg.getText());
double mg = g * 1000;
double kg = g / 1000;
txtmg.setText("" + mg);
txtkg.setText(""+kg);
txtt.setText(""+ ton);
} catch (Exception e) {
if (input.isEmpty()){
} else try {
double kg = Double.parseDouble(txtkg.getText());
double mg = kg * 1e+9;
double g = kg * 1000;
txtmg.setText("" + mg);
txtg.setText(""+g);
txtt.setText(""+ ton);
} catch (Exception e) {
}
String input = txtt.getText();
if (input.isEmpty()){
} else try {
txtmg.setText("" + mg);
txtg.setText(""+ g);
txtkg.setText(""+ kl);
} catch (Exception e) {
Length code
if (input.isEmpty()){
} else try {
double mm = Double.parseDouble(txtmm.getText());
double cm = mm /10;
double m = mm * 0.001;
double dc = mm / 100;
double km = mm * 0.000001;
double ft = mm * 39370;
double inch = mm * 0.039370078740157477;
txtcm.setText("" + cm);
txtm.setText("" + m);
txtdm.setText("" + dc);
txtkm.setText("" + km);
txtmile.setText("" + mile);
txtft.setText("" + ft);
txtinch.setText("" + inch);
} catch (Exception e) {
if (input.isEmpty()){
} else try {
double cm = Double.parseDouble(txtcm.getText());
double mm = cm * 10;
double m = mm / 100;
double dc = mm / 10;
double km = mm / 1000000;
double ft = mm / 30.48;
txtmm.setText("" + mm);
txtm.setText("" + m);
txtdm.setText("" + dc);
txtkm.setText("" + km);
txtmile.setText("" + mile);
txtft.setText("" + ft);
txtinch.setText("" + inch);
} catch (Exception e) {
if (input.isEmpty()){
} else try {
double m = Double.parseDouble(txtm.getText());
double mm = m * 1000;
double cm = m * 100;
double dc = m * 10;
double km = m / 1000;
double ft = m / 30.48;
txtmm.setText("" + mm);
txtcm.setText("" + cm);
txtdm.setText("" + dc);
txtkm.setText("" + km);
txtmile.setText("" + mile);
txtft.setText("" + ft);
txtinch.setText("" + inch);
} catch (Exception e) {
}
if (input.isEmpty()){
} else try {
double dm = Double.parseDouble(txtdm.getText());
double mm = dm * 100;
double m = dm / 10;
double cm = dm * 10;
double km = dm / 10000;
double ft = dm / 3.048;
txtmm.setText("" + mm);
txtm.setText("" + m);
txtcm.setText("" + cm);
txtkm.setText("" + km);
txtmile.setText("" + mile);
txtft.setText("" + ft);
txtinch.setText("" + inch);
} catch (Exception e) {
if (input.isEmpty()){
} else try {
double km = Double.parseDouble(txtkm.getText());
double mm = km * 1e+6;
double m = km * 1000;
double cm = km * 100000;
double dc = km * 10000;
double ft = km * 3281;
txtmm.setText("" + mm);
txtm.setText("" + m);
txtcm.setText("" + cm);
txtdm.setText("" + dc);
txtmile.setText("" + mile);
txtft.setText("" + ft);
txtinch.setText("" + inch);
} catch (Exception e) {
if (input.isEmpty()){
} else try {
double mile = Double.parseDouble(txtmile.getText());
txtmm.setText("" + mm);
txtm.setText("" + m);
txtcm.setText("" + cm);
txtdm.setText("" + dm);
txtkm.setText("" + km);
txtft.setText("" + ft);
txtinch.setText("" + inch);
} catch (Exception e) {
if (input.isEmpty()){
} else try {
double ft = Double.parseDouble(txtft.getText());
double mm = ft * 304.8;
double m = ft / 3.281;
double cm = ft * 30.48;
double dm = ft * 3.048;
double km = ft / 3281;
txtmm.setText("" + mm);
txtm.setText("" + m);
txtcm.setText("" + cm);
txtdm.setText("" + dm);
txtkm.setText("" + km);
txtmile.setText(""+ mile);
txtinch.setText("" + inch);
} catch (Exception e) {
if (input.isEmpty()){
} else try {
txtmm.setText("" + mm);
txtm.setText("" + m);
txtcm.setText("" + cm);
txtdm.setText("" + dm);
txtkm.setText("" + km);
txtmile.setText(""+ mile);
txtft.setText("" + ft);
} catch (Exception e) {