Skip to content

Instantly share code, notes, and snippets.

Created March 20, 2018 06:26
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Indirection without abstraction - Snippet 3
public class ExportPanelForm {
private static final String EXPORTING = "Exporting";
private static final String DOT = ".";
private JLabel exportingLabel;
public void updateExportingLabel() {
String newText = cycle(exportingLabel.getText(), 19);
public void showExporting() {
exportingLabel.setText(EXPORTING + DOT);
private static String cycle(String currentText, int maxLength) {
return currentText.length() == maxLength
: currentText + DOT;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment