Skip to content

Instantly share code, notes, and snippets.

@raadad
Last active August 29, 2015 13:56
Show Gist options
  • Save raadad/9180907 to your computer and use it in GitHub Desktop.
Save raadad/9180907 to your computer and use it in GitHub Desktop.
package com.nik;
import org.eclipse.swt.*;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
public class Main {
public void saveText(){
};
public static void main(String[] args) {
Display display = new Display ();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout ());
Group leftSide = new Group(shell,0);
leftSide.setLayout(new FillLayout());
Group rightSide = new Group(shell, 0);
rightSide.setLayout(new FillLayout());
Group topLeftSide = new Group(leftSide, 0);
topLeftSide.setLayout(new FillLayout());
Group bottomLeftSide = new Group(leftSide, 0);
bottomLeftSide.setLayout(new FillLayout());
FillLayout leftSideSplit = new FillLayout();
leftSideSplit.type = SWT.VERTICAL;
leftSide.setLayout(leftSideSplit);
@SuppressWarnings("unused")
final Text text = new Text(rightSide, 0); //why complain???
final Text convoBox = new Text(topLeftSide, 0);
convoBox.setEditable(false);
//convoBox.setText("Hello World!");
final Button button1 = new Button(topLeftSide, 0);
button1.setText("Send");
String convo = "";
text.addListener(SWT.CAPS_LOCK);
///////////////////////////////
button1.addListener(SWT.Selection, new Listener(){
@Override
public void handleEvent(Event arg0) {
}
});
//if(keyPressed())
System.out.println(convo);
//if(button1.handleEvent());
FillLayout fillLayout = new FillLayout();
fillLayout.type = SWT.VERTICAL;
//fillLayout.spacing = 100;
//shell.setLayout(fillLayout);
shell.open ();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ())
display.sleep ();
}
display.dispose ();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment