Skip to content

Instantly share code, notes, and snippets.

@itsakt
Last active February 4, 2017 14:06
Show Gist options
  • Save itsakt/81e03694d75143856bb28c396509635f to your computer and use it in GitHub Desktop.
Save itsakt/81e03694d75143856bb28c396509635f to your computer and use it in GitHub Desktop.
public class ToolWindowHandler implements ToolWindowFactory {
private JPanel toolWindowContent;
private JTextField txtName;
private JButton btnGo;
private JLabel lblHello;
@Override
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
Content content = contentFactory.createContent(toolWindowContent, "", false);
toolWindow.getContentManager().addContent(content);
btnGo.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
lblHello.setText("Hello " + txtName.getText() + " o/");
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment