Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- final Display display = new Display();
- Shell shell = new Shell(display);
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 1;
- shell.setLayout(gridLayout);
- final Text text1 = new Text (shell, SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);
- text1.setLayoutData(new GridData(GridData.FILL_BOTH));
- text1.addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent e) {
- if(e.keyCode == SWT.CR) {
- String textData = text1.getText();
- text1.setText("");
- text1.setSelection(0);
- }
- }
- });
Add Comment
Please, Sign In to add comment