Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 5300 Details for
Bug 38757
BIDI - on a 102 keyboard, English Layer, there is a key conflict
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
test case
MyTextField.java (text/plain), 3.47 KB, created by
Nagia El Haraki
on 2003-06-26 08:43:57 EDT
(
hide
)
Description:
test case
Filename:
MIME Type:
Creator:
Nagia El Haraki
Created:
2003-06-26 08:43:57 EDT
Size:
3.47 KB
patch
obsolete
>import org.eclipse.swt.widgets.*; >import org.eclipse.swt.SWT; >import org.eclipse.swt.events.*; > >import java.awt.*; > > >public class MyTextField { > > Shell shell; > Display display; > > public static void main(String[] args) > { > MyTextField me = new MyTextField(); > me.go(); > me.run(); > } > > public MyTextField() > { > super(); > } > > public void go() > { > createSWT(); > createAWT(); > } > > void run () { > Display display = shell.getDisplay (); > while (!shell.isDisposed ()) > if (!display.readAndDispatch ()) display.sleep (); > } > > void createShell () { > > display = new Display(); > shell = new Shell (display); > shell.setText ("My Title"); > org.eclipse.swt.layout.GridLayout layout = new org.eclipse.swt.layout.GridLayout(); > layout.numColumns = 1; > shell.setSize(500, 300); > shell.setLayout(layout); > } > > void close () { > if (shell != null && !shell.isDisposed ()) > shell.dispose (); > } > > public void createSWT() > { > createShell(); > > shell.addShellListener(new ShellListener() { > > public void shellActivated(ShellEvent e) > { > System.out.println("Shell activated.."); > } > public void shellClosed(ShellEvent e) > { > System.out.println("Shell closed.."); > } > public void shellDeactivated(ShellEvent e) > { > System.out.println("Shell deactivated.."); > } > public void shellDeiconified(ShellEvent e) > { > System.out.println("Shell unminimized.."); > } > public void shellIconified(ShellEvent e) > { > System.out.println("Shell minimized.."); > } > }); > > Text t = new Text(shell, SWT.SINGLE); > > t.addKeyListener(new org.eclipse.swt.events.KeyListener() { > public void keyPressed(org.eclipse.swt.events.KeyEvent ke) { > System.out.println("SWT KeyPressed...character - "+ke.character+", keyCode - "+ke.keyCode+", stateMask - "+ke.stateMask); > } > > public void keyReleased(org.eclipse.swt.events.KeyEvent ke) { > System.out.println("KeyReleased...character - "+ke.character+", keyCode - "+ke.keyCode+", stateMask - "+ke.stateMask); > } > }); > > shell.open(); > } > > private void createAWT() > { > Frame f = new Frame("AWT Frame"); > Panel p = new Panel(); > TextField tf = new TextField(40); > > tf.addKeyListener(new java.awt.event.KeyListener() { > public void keyPressed(java.awt.event.KeyEvent ke) { > System.out.println("AWT KeyPressed...character - "+ke.getKeyChar()+", keyCode - "+ke.getKeyCode()); > } > > public void keyReleased(java.awt.event.KeyEvent ke) { > } > > public void keyTyped(java.awt.event.KeyEvent ke) { > } > }); > p.add(tf); > f.add(p); > > f.setSize(400, 200); > > f.addWindowListener(new java.awt.event.WindowAdapter() { > public void windowClosing(java.awt.event.WindowEvent evt) > { > System.exit(0); > } > }); > > f.show(); > > } > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 38757
:
5241
| 5300