Cloudgarden's Discussion Board
Forums: Search: Several forums are available for people to post questions/comments about Java Speech or any of the CloudGarden products. As more messages are posted this discussion board should provide a useful, searchable, support database.
o AliceTalker (42)
o JSAPI Projects (69)
o Java Speech API (857)
o Jigloo GUI Builder for Eclipse (3322)
o SwingScroller (0)
o US Election 2004 (3)
Searches text and subject fields in all forums. The search matches as many words as possible. Don't use "AND" or "OR".
Latest "Java Speech API" Topics [ Start new "Java Speech API" Topic  ]

Enter name (no spaces) and text (< 2000 chars).
Name:
Watch thread: (an email will be sent to you when a reply is posted to this thread)
Email (if watching thread): (will not be made public, or shared with anyone)
Save name & email: (will store info in a cookie)
Subject: Re: visualproject

To prevent spamming, please type this code "saeras" in the box.
Text:

Replying to:
visualproject
Author: rawan
12/15/09 03:31

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class MyWindow extends JFrame implements ActionListener
{
public static final int WIDTH=300;
public static final int HEIGHT=200;
private JTextField subjectTextField,startTextField,dueTextField, priorityTextField,
doneTextField,notDoneTextField;
public static final int LINES=2;
public static final int CHAR_PER_LINES=10;
private JTextArea theText,theTic;
public MyWindow()
{
setTitle("Main window" );
setSize(WIDTH,HEIGHT);
getContentPane().setLayout(new FlowLayout());
getContentPane().setBackground(Color.BLUE);
JLabel ttuLab= new JLabel("i");
ImageIcon ttu = new ImageIcon("ttu.gif");
ttuLab.setIcon(ttu);
getContentPane().add(TtuLab,BorderLayout.WEST);
JButton insertButton= new JButton("insert");
insertButton.addActionListener(this);
getContentPane().add(insertButton);
JButton retriveButton = new JButton("Retrive");
retriveButton.addActionListener(this);
getContentPane().add(retriveButton);
}
{
JFrame x2=new JFrame();
x2.setTitle("Hello");
x2.setSize(WIDTH,HEIGHT);
getContentPane().setLayout(new BorderLayout());
getContentPane().setBackground(Color.PINK);
JPanel userPanel = new JPanel();
userPanel.setLayout(new GridLayout(1,1));
userPanel.setBackground(Color.YELLOW);
JLabel subjectName = new JLabel(" subject name:");
userPanel.add(subjectName);
subjectTextField = new JTextField(20);
getContentPane().add(userPanel,BorderLayout.WEST);




JMenu statusMenu= new JMenu("status");
JMenuItem s;
s= new JMenuItem("in progress");
s.addActionListener(this);
statusMenu.add(s);
s= new JMenuItem("completed");
s.addActionListener(this);
statusMenu.add(s);
s= new JMenuItem("deferred");
s.addActionListener(this);
statusMenu.add(s);
JMenuBar sBar= new JMenuBar();
sBar.add(statusMenu);
setJMenuBar(sBar);
JPanel textPanel =new JPanel();
textPanel.setBackground(Color.BLUE);
theText = new JTextArea(LINES,CHAR_PER_LINES);
textPanel.add(theText);


theText.setBackground(Color.WHITE);
JScrollPane ScrolledText = new JScrollPane(theText);
ScrolledText.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
ScrolledText.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
textPanel.add(ScrolledText);
getContentPane().add(textPanel,BorderLayout.CENTER);


JPanel myPanel = new JPanel();
myPanel.setBackground(Color.WHITE);
myPanel.setLayout(new GridLayout(3,2));
JLabel startLabel = new JLabel("start date:");
myPanel.add(startLabel);
startTextField = new JTextField(20);
myPanel.add(startTextField);
JLabel dueLabel = new JLabel("Due date:");
myPanel.add(dueLabel);
dueTextField = new JTextField(20);
myPanel.add(dueTextField);
JLabel priorityLabel = new JLabel("priority:");
myPanel.add(priorityLabel);
priorityTextField = new JTextField(20);
myPanel.add(priorityTextField);
getContentPane().add(myPanel,BorderLayout.SOUTH);
}
JFrame x3=new JFrame();
     {
x3.setTitle("hello");
x3.setSize(WIDTH,HEIGHT);
x3.getContentPane().setLayout(new BorderLayout());
x3.getContentPane().setBackground(Color.RED);
JLabel subLabel = new JLabel("the subject name you Entered is");
x3.getContentPane().add(subLabel);
x3.getContentPane().add(subLabel,"NORTH");
JMenu chooseMenu = new JMenu("choose");
JMenuItem c;
c = new JMenuItem("done");
c.addActionListener(this);
chooseMenu.add(c);
c = new JMenuItem(" not done");
c.addActionListener(this);
chooseMenu.add(c);
JMenuBar cBar= new JMenuBar();
cBar.add(chooseMenu);
setJMenuBar(cBar);
JPanel ticPanel = new JPanel();
ticPanel.setBackground(Color.YELLOW);
theTic = new JTextArea( LINES,CHAR_PER_LINES);
ticPanel.add(theTic);
x3.getContentPane().add(theTic,BorderLayout.EAST);
}
public static void main (String[] args)
{
     JFrame x3= new JFrame();
          MyWindow object1 = new MyWindow();
          object1.setVisible(true);
         
}
public void actionPerformed(ActionEvent e)
{
JFrame x2= new JFrame();
if(e.getActionCommand().equals("insert"))
{
     x2.setVisible(true);
          {
          if (e.getActionCommand().equals(" in progress"))
theText.setText("in progress");
else if (e.getActionCommand().equals("completed"))
theText.setText("completed");
else if (e.getActionCommand().equals("deferrd"))
theText.setText("deferred");
else
theText.setText("error");
     }
     }
{
if(e.getActionCommand().equals("Retrive"))
{
          x3.setVisible(true);
{
if (e.getActionCommand().equals("doing"))
theTic.setText("* doing");
else if (e.getActionCommand().equals("not doing"))
theTic.setText("* not doing");
else
theTic.setText("Error");
     }
     }
else
System.out.println("Error in button you Pressed");
     }
    
}
}