use show() instead

This commit is contained in:
Manindra Moharana
2013-09-16 21:39:42 +05:30
parent 82a3bfc6e6
commit 46d74909c2
2 changed files with 5 additions and 4 deletions

View File

@@ -101,12 +101,14 @@ public class CompletionPanel {
scrollPane.setViewportView(completionList);
scrollPane.validate();
popupMenu.setSize(dimen);
popupMenu.setLocation(location);
//popupMenu.setLocation(location);
this.subWord = new String(newSubword);
if (subWord.indexOf('.') != -1)
this.subWord = subWord.substring(subWord.lastIndexOf('.') + 1);
insertionPosition = position;
log("Suggestion updated" + System.nanoTime());
popupMenu.show(textarea, location.x, textarea.getBaseline(0, 0)
+ location.y);
return true;
}

View File

@@ -733,9 +733,8 @@ public class TextArea extends JEditTextArea {
suggestion = new CompletionPanel(this, position, subWord, defListModel,
location,editor);
else
suggestion.updateList(defListModel, subWord,
new Point(getLocationOnScreen().x + location.x,
getLocationOnScreen().y + location.y), position);
suggestion.updateList(defListModel, subWord, location, position);
suggestion.setVisible(true);
// requestFocusInWindow();
SwingUtilities.invokeLater(new Runnable() {