Code example for JLabel

Methods: setVisiblegetTextsetText

0
			if (profile instanceof Profile3G) {
				// Showing additional labels in case of 3G profile 
				rrcParam4Label.setVisible(true);
				rrcParam4ValueLabel.setVisible(true);
				rrcParam5Label.setVisible(true);
				rrcParam5ValueLabel.setVisible(true);
				rrcParam6Label.setVisible(true);
				rrcParam6ValueLabel.setVisible(true);
				rrcParam7Label.setVisible(true);
				rrcParam7ValueLabel.setVisible(true);
				rrcParam8Label.setVisible(true);
				rrcParam8ValueLabel.setVisible(true);
				 
				rrcParam9Label.setVisible(false);
				rrcParam9ValueLabel.setVisible(false);
				rrcParam10Label.setVisible(false);
				rrcParam10ValueLabel.setVisible(false);
 
				rrcParam1Label.setText(rb.getString("rrc.dch"));
				rrcParam2Label.setText(rb.getString("rrc.fach"));
				rrcParam3Label.setText(rb.getString("rrc.idle"));
				rrcParam4Label.setText(rb.getString("rrc.idle2dch"));
				rrcParam5Label.setText(rb.getString("rrc.fach2dch"));
				rrcParam6Label.setText(rb.getString("rrc.dchTailRatio"));
				rrcParam7Label.setText(rb.getString("rrc.fachTailRatio"));
				rrcParam8Label.setText(rb.getString("rrc.promotionRatio"));
 
				valueAndPct = rb.getString("rrc.valueAndPct");
				rrcParam1ValueLabel.setText(MessageFormat.format(valueAndPct,
						nf.format(rrc.getDchTime()), nf.format(rrc.getDchTimeRatio() * 100.0)));
				rrcParam2ValueLabel.setText(MessageFormat.format(valueAndPct,
						nf.format(rrc.getFachTime()), nf.format(rrc.getFachTimeRatio() * 100.0)));
				rrcParam3ValueLabel.setText(MessageFormat.format(valueAndPct,
						nf.format(rrc.getIdleTime()), nf.format(rrc.getIdleTimeRatio() * 100.0)));
				rrcParam4ValueLabel.setText(MessageFormat.format(valueAndPct,
						nf.format(rrc.getIdleToDchTime()),
						nf.format(rrc.getIdleToDchTimeRatio() * 100.0)));
				rrcParam5ValueLabel.setText(MessageFormat.format(valueAndPct,
						nf.format(rrc.getFachToDchTime()),
						nf.format(rrc.getFachToDchTimeRatio() * 100.0)));
				rrcParam6ValueLabel.setText(nf.format(rrc.getDchTailRatio()));
				rrcParam7ValueLabel.setText(nf.format(rrc.getFachTailRatio()));
				rrcParam8ValueLabel.setText(nf.format(rrc.getPromotionRatio()));
 
				rrcContent.put(rb.getString("rrc.dch"), rrcParam1ValueLabel.getText());
				rrcContent.put(rb.getString("rrc.fach"), rrcParam2ValueLabel.getText());
				rrcContent.put(rb.getString("rrc.idle"), rrcParam3ValueLabel.getText());
				rrcContent.put(rb.getString("rrc.idle2dch"), rrcParam4ValueLabel.getText());
				rrcContent.put(rb.getString("rrc.fach2dch"), rrcParam5ValueLabel.getText());
				rrcContent.put(rb.getString("rrc.dchTailRatio"), rrcParam6ValueLabel.getText());
				rrcContent.put(rb.getString("rrc.fachTailRatio"), rrcParam7ValueLabel.getText());
				rrcContent.put(rb.getString("rrc.promotionRatio"), rrcParam8ValueLabel.getText());
			} else if (profile instanceof ProfileLTE) {