Home Answers Viewqa Swing-AWT SWT_AWT bridge ,jtextfield edit problem

 
 


Sachintendulkar
SWT_AWT bridge ,jtextfield edit problem
1 Answer(s)      4 years and 6 months ago
Posted in : Swing AWT

View Answers

November 25, 2008 at 11:33 PM


Hi friend,

Code to solve the problem :

import java.awt.event.*;

import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.awt.*;

public class SWT_AWT {

public static void main(String[] args) {
final Display display = new Display( );
final Shell shell = new Shell(display);
shell.setText("Using Swing and AWT");
shell.setSize(350, 280);

Composite composite = new Composite(shell, SWT.EMBEDDED);
composite.setBounds(20, 20, 300, 200);
composite.setLayout(new RowLayout( ));

java.awt.Frame frame = SWT_AWT.new_Frame(composite);
java.awt.Panel panel = new java.awt.Panel( );
frame.add(panel);

final javax.swing.JButton button = new javax.swing.JButton("Click Me");
final javax.swing.JTextField text = new javax.swing.JTextField(20);

panel.add(button);
panel.add(text);

button.addActionListener(new ActionListener( ) {
public void actionPerformed(ActionEvent event) {
text.setText("Yep, it works.");
}
});

shell.open( );
while(!shell.isDisposed( )) {
if (!display.readAndDispatch( )) display.sleep( );
}
display.dispose( );
}
}

For more information on Swing visit to :

http://www.roseindia.net/java/example/java/swing/

Thanks









Related Pages:
SWT_AWT bridge ,jtextfield edit problem - Swing AWT
SWT_AWT bridge ,jtextfield edit problem  Hi All, I am using SWT_AWT bridge in my code to embed swing components in to SWT Composite. I am using SWT_AWT bridge frame and adding JTextfield to it, My problem is that the JTextfield
jtextfield
jtextfield  hii..is it possible to make a jtextfield in login page in such a way that some text should already be inserted like username and it should be displayed light in color and when a user enters some text then it should
How to return a string from a JTextField
trying to get a string from a JTextField so that I can compare it with another.... The problem is i have no clue how to get the very string i need because i think...(); final JTextField text=new JTextField(20); JButton b=new JButton
Copy data from one JTextField to another JTextField
Copy data from one JTextField to another JTextField..., you will learn how to copy the data from one JTextField into another JTextField. When you run this program it starts with two JTextField. Enter some
tooltip problem - Swing AWT
tooltip problem  Hi All, I am using SWT_AWT bridge in my code to embed swing components into SWT Composite. I am using a Swing JButton in SWT Composite. My problem is that I am unable to see the tooltip for this button even
The JDBC-ODBC Bridge.
The JDBC-ODBC Bridge.  Are there any ODBC drivers that do not work with the JDBC-ODBC Bridge
radio button value on edit action
provided show edit add and delete link for each customer that is searched...Problem 'm facing is on edit action 'm not retrieving radio button value..i have...radio button value on edit action  This is my edit.jsp code...In my
jTextField in swing
jTextField in swing  I am new to java and i am making a registration form.i just want to know if there is any code in which a string cannot be inserted in a jtextfield where a phone number has to be inserted.the jtextfield should
I have problem in my Project
I have problem in my Project  Dear Sir, i have problem in my project about Jtable i have EDIT JButton whenevery i was click on edit he is display all data from database but i want to select any row
Jlist and JTextfield
Jlist and JTextfield  How can we filter values from jlist by adding only a single letter in jtextfield such that when letter S is pressed in jtextfield then jlist should diplay all the values starting from letter S.I am using
java jtextfield
java jtextfield  how to validate jTextField which accept only number or alphabets from keyboard....plez do help me
JDBC-ODBC Bridge multi-threaded.
JDBC-ODBC Bridge multi-threaded.  Is the JDBC-ODBC Bridge multi-threaded
Bridge table in SQL
Bridge table in SQL  I have 2 tables: professors(professorid INT PK, name VARCHAR), courses(courseid INT PK, title). I also have a bridge table... for something like this: given the professor name, "x" Using the bridge table
Drop down and radio button value on edit action
the value from dropdown and radio button.. But the problem goes with edit action.. While the edit form is being displayed it gets all the values from the database...Drop down and radio button value on edit action  HI, I have
Add Edit And Delete Employee Information
Add Edit and Delete Employee Information Using Swing  ..., edit and delete the Employee's information from the database using java swing..., we have created  three forms using JLabel and JTextField class which
Weigh Bridge integration using java
Weigh Bridge integration using java  Hi!! every one, my name is srihari, i am a java developer. now i need a solution for my project. How can i... from the weighing bridge, and save the data in database using java, after that i
JTextField
Java: JTextField Description javax.swing.JTextField has two uses... of more than one line, use a JTextArea. Overview of methods JTextField JTextField(width) setText(text) StringgetText() addActionListener(listener
float validation for jTextField
float validation for jTextField  Hi; I try that users enter only float number into jtextfield but I can not handle it. I try regex in keylistener but I couldn't be successful. Can you help me please
JtextField - Java Beginners
JtextField  Hi, How can I populate a jtextfield of another Jframe...; JLabel label1,label2; JTextField text1,text2; Form() { label1 = new JLabel(); label1.setText("First Name:"); text1 = new JTextField(20
FOP Bridge
FOP Bridge       The FOP bridge plugin provides eclipse users the ability to convert... a log of FOP's progress. FOP Bridge can also integrate rendering
updation problem during transaction to ms-access
); tf10=new JTextField(12); editbtn1=new JButton("Edit "); editbtn2=new JButton...updation problem during transaction to ms-access  Hey friends I am a beginner to java,and my problem is related to updation query in ms
updation problem during transaction to ms-access
); tf10=new JTextField(12); editbtn1=new JButton("Edit "); editbtn2=new JButton...updation problem during transaction to ms-access  Hey friends I am a beginner to java,and my problem is related to updation query in ms
updation problem during transaction to ms-access
); tf10=new JTextField(12); editbtn1=new JButton("Edit "); editbtn2=new JButton...updation problem during transaction to ms-access  Hey friends I am a beginner to java,and my problem is related to updation query in ms
updation problem during transaction to ms-access
); tf10=new JTextField(12); editbtn1=new JButton("Edit "); editbtn2=new JButton...updation problem during transaction to ms-access  Hey friends I am a beginner to java,and my problem is related to updation query in ms
Problem with JRadioButton and Access Database - Java Beginners
Problem with JRadioButton and Access Database  Hello sir ,Here I have... btnimg1,btnimg2; JLabel l1, l2, l3, l4,l5,l6,l7,l8,l9,l10,l11,l12; JTextField tf1,tf2,tf3,tf4,tf5,tf6,tf7,tf8,tf9,tf10; JRadioButton r1,r2; JScrollPane sp1; JTextField
edit data
edit data  sir i want to do edit a particular customers information after he logs in, i am also using sessions. thank you
Edit Distance
Edit Distance  I want java programming ask from user input two string and the program find the edit distance between two strings and find table and optimal solution using GUI
How to edit values in textboxes from database using jsp
How to edit values in textboxes from database using jsp  Hi RoseIndia, I need help to solve my technical problem, i want to edit values in textboxes...:bold;" align="center">Edit User</td></tr> <tr><
Edit the record.
Edit the record.  sir, I have a table consist of huge data.I have displayed that data.side of them there is an edit button which will edit that particular record.after editing the data i want to edit another row which is next
Problem with Java Source Code - Java Beginners
Problem with Java Source Code  Dear Sir I have Following Source Code ,But There is Problem with classes, plz Help Me. package mes.gui; import...; showStudentList studList; String custno="",compname=""; JTextField ID
problem of confirmation
problem of confirmation  sir, I tried ur code but when i click...; <h3>Delete Supplier OR Edit Supplier</h3> <...;nbsp;&nbsp;<input size="15" type="submit" value="Edit" name="insert" />
Java JTextField Validation - Java Beginners
Java JTextField Validation  Hello Sir ,How I can Validate JTextField In Java,when I enter Any Character value in JTextField ,I want To Display MsgBox... Validation extends JFrame{ JTextField text; JLabel l1,l2; JPanel p
reconfirm problem
OR Edit Supplier
JTextField Validation in java swing
JTextField Validation in java swing In this tutorial, you will learn how to validate jtextfield in java swing. Here we have created a textfield on frame... extends JFrame{ JTextField text; JLabel label; JPanel p; TextValidation(){ text
Edit image - XML
Edit image  How to edit my Image Document Online?  Just visit http://www.onlinedocumentconversion.com/ and register there, upload and convert your image
validate jtextfield in two different class use keylistener
validate jtextfield in two different class use keylistener  validate jtextfield in java swing will use two class, design part in one class and method calling in one class will use Keylisteners or change listeners
how to edit a record in hibernate?
how to edit a record in hibernate?  how to edit a record in hibernate?   Hi Friend, Please visit the following link: Hibernate Tutorials Thanks   Hi Friend, Please visit the following link: Hibernate
Edit cron entry
Edit cron entry   Hi, What is the command to Edit cron entry in linux? Regards Deepak Kumar   Hi, You can use the following command to open cron configuration in vi editor: crontab -e After editing just save
please help me to this problem..
please help me to this problem..  i wrote a program like keyboard and i used [JTextFiled] means that just you can write inside the program (i.e inside the JTextField) but i want to make this program to let me write where i
UINavigationBar Edit Button
UINavigationBar Edit Button  UINavigationBar Edit Button Given is the code that adds a edit button item as a nav bar item in your UINavigation Controller. -(void)viewDidLoad; { [super viewDidLoad]; UINavigationBar* navBar
GUI problem - Java Beginners
GUI problem  how to write java program that use JTextField to input data and JTextField to display the output when user click Display Button??  Handle the actionPerformed event for JButton and try doing something like
uitableview edit done button
uitableview edit done button  How to add Edit / Done button in UITableView with an action on click?   UITableview Edit done Button To add " Edit / Done button " in UITableView add the given code in UIView Controller
Javascript problem - WebSevices
before submitting the form with the condition of being empty. PROBLEM:-->... the database value and if the user wants he can edit. Thanks..  Hi friend, Please specify the problem : You want to return back same page
JDBC ODBC related problem
_Customer extends JFrame implements ActionListener,ItemListner { JTextField textFieldId; JTextField textFieldName; JTextField textFieldContactNo...); textFieldId = new JTextField(); textFieldName = new JTextField
problem in forwarding response
problem in forwarding response  My response is not getting displayed. i have used RequestDispatcher.forward,RequestDispatcher.include... displays all records present in table and when user clicks on edit button
code related problem
class Mybutton11 extends JFrame { JTextField text1 = new JTextField(20...); JLabel label2=new JLabel("Enter your age:", Label.RIGHT); JTextField text2 = new JTextField(20); JLabel label3=new JLabel("Enter your course
easy way to make a JCombobox look like a JTextField?
easy way to make a JCombobox look like a JTextField?  Is there a good(and easy) way to make a JCombobox look like a JTextField? By this I mean there should not be a dropdown button, but when the user enters something it should
Bridge Pattern
Bridge Pattern      ... with the Bridge Design Pattern. It does that simply by decoupling... with the implementations at the compile time, However the Bridge pattern hides
dsn problem - JDBC
of the Class class. forName() takes one string parameter JDBC-ODBC Bridge

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.