Select to view content in your preferred language

Java Dockablewindow Disabled JTextField.

4197
6
Jump to solution
01-10-2011 03:19 PM
ShaunMartin
Emerging Contributor
Hi,

I have created a add-in for Arcmap that contains a DockableWindow with a panel and a JButton and JTextfield. When I load the DockableWindow my button and textfield are visible and the button behaves as correctly and can be clicked .The textfield is un-useable it will not allow adding text etc. I have ensured that it is editable via the code and I have even tried to force the focus via the code but I'm still unable to use it. I have also tried using a JTextArea with the same result.

Here is a sample of the code from the dockablewindow createUI method

@Override
  public Component createUI() {
  
   panel = new JPanel();
     
      keywordTF = new JTextField(10);
      keywordTF.setText("something");
      panel.setLayout(new BorderLayout());
       
      panel.add(keywordTF,BorderLayout.NORTH);
      return panel;

  }

Any help with this would be great.

Thanks Shaun
0 Kudos
1 Solution

Accepted Solutions
KeithCroteau
Deactivated User
Hi Shaun - I logged and incident with ESRI and they have just confirmed that
this is a bug.  I will post again if ESRI contacts me with a fix, or if I find a workaround. 

Thanks, Keith

Excerpt from Esri:

Here is the defect which is logged for this issue:
NIM060914: "Dockable Window does not recognize JTextField.setEditable(true) text field for a Java".

View solution in original post

0 Kudos
6 Replies
KeithCroteau
Deactivated User
Hi Shaun - did you have any luck resolving this?  I am having the same problem.
Thanks.


Hi,

I have created a add-in for Arcmap that contains a DockableWindow with a panel and a JButton and JTextfield. When I load the DockableWindow my button and textfield are visible and the button behaves as correctly and can be clicked .The textfield is un-useable it will not allow adding text etc. I have ensured that it is editable via the code and I have even tried to force the focus via the code but I'm still unable to use it. I have also tried using a JTextArea with the same result.

Here is a sample of the code from the dockablewindow createUI method

@Override
  public Component createUI() {
  
   panel = new JPanel();
     
      keywordTF = new JTextField(10);
      keywordTF.setText("something");
      panel.setLayout(new BorderLayout());
       
      panel.add(keywordTF,BorderLayout.NORTH);
      return panel;

  }

Any help with this would be great.

Thanks Shaun
0 Kudos
ShaunMartin
Emerging Contributor
Hi Keith,

No unfortunately I haven't been able to resolve this problem. You would think that ESRI would monitor these forums and give some solution to issues such as this.

Cheers,
Shaun
0 Kudos
KeithCroteau
Deactivated User
Hi Shaun - I logged and incident with ESRI and they have just confirmed that
this is a bug.  I will post again if ESRI contacts me with a fix, or if I find a workaround. 

Thanks, Keith

Excerpt from Esri:

Here is the defect which is logged for this issue:
NIM060914: "Dockable Window does not recognize JTextField.setEditable(true) text field for a Java".
0 Kudos
TomSchuller
Frequent Contributor
Hy,
I'm also blocked by this bug.

Has anybody a workaround or an information for the fix?

Thanks,
Tom
0 Kudos
ShaunMartin
Emerging Contributor
Hi Tom,

The only work around I could think of was to put an edit button that pops a JOptionPane get the input and push it into the disabled edit box. Ugly I know but its the only way I could think of.

Cheers,
Shaun
0 Kudos
GregSpiridonov
Occasional Contributor

As far as I can tell it is still an issue in the 10.4 prerelease Java API.

0 Kudos