Skip to content

Instantly share code, notes, and snippets.

@ggalmazor
Last active March 20, 2018 06:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ggalmazor/1f28b3b74048160b395b86eaf8f5668b to your computer and use it in GitHub Desktop.
Save ggalmazor/1f28b3b74048160b395b86eaf8f5668b to your computer and use it in GitHub Desktop.
Indirection without abstraction - Snippet 2
public class ExportPanelForm {
private static final String EXPORTING = "Exporting";
private static final String DOT = ".";
private JLabel exportingLabel;
public void updateExportingLabel() {
String text = exportingLabel.getText();
if (text.equals(EXPORTING + DOT + DOT + DOT + DOT + DOT + DOT + DOT + DOT + DOT + DOT)) {
text = EXPORTING + DOT;
} else {
text += DOT;
}
exportingLabel.setText(text);
}
public void showExporting() {
exportingLabel.setText(EXPORTING + DOT);
exportingLabel.setVisible(true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment