All pastes #45790 Raw Edit

Mag

public text v1 · immutable
#45790 ·published 2006-03-15 05:15 UTC
rendered paste body
public class Testing extends Dialog {
  String value, name;
  
  String Test_SPC = "Some text goes in here";
  String This_SPC = "Other stuff";
  String That_SPC = "MOre strings";

  /**
   * @param parent
   */
  public Testing(Shell parent, String tip) {
    super(parent); name = tip;
  }

  /**
   * @param parent
   * @param style
   */
  public Testing(Shell parent, int style) {
    super(parent, style);
  }

  /**
   * Makes the dialog visible.
   * 
   * @return
   */
  public String open() {
    Shell parent = getParent();
    final Shell shell =
      new Shell(parent, SWT.TITLE | SWT.BORDER | SWT.APPLICATION_MODAL);
    
    Label label = new Label(shell, SWT.WRAP);
    label.setText("Examples: " + getText()+"_SPC");
    label.setBounds(9,9,296,44);




    shell.open();

    Display display = parent.getDisplay();
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch())
        display.sleep();
    }

    return value;
  }

  public static void main(String[] args) {
    Shell shell = new Shell();
    SkillSpecial dialog = new SkillSpecial(shell,"");
    System.out.println(dialog.open());
  }
  
  
}


//took some code out to show the problem, I know everything works, but when I call for the getText() + "_SPC" inside of setText() I just get the name with _SPC, not the value of the string