LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-05-2009, 03:48 AM   #16
Bevin1990
LQ Newbie
 
Registered: Jul 2009
Posts: 12

Original Poster
Rep: Reputation: 0

ya...the structure of the code is by me...i encountered prob and posted the code...aspire was just trying to help me with the troubleshoot while nt changing most of it..if he change it,wouldnt it be spoon feeding me?...
 
Old 08-11-2009, 10:27 PM   #17
Bevin1990
LQ Newbie
 
Registered: Jul 2009
Posts: 12

Original Poster
Rep: Reputation: 0
hey aspire...need ur help once again..i have to change the textfield that i currently using for input to JtextArea...any pointer to note...cos i did some changes and my textarea just disappear...




* @(#)epitope1.java
*
*
* @author
* @version 1.00 2009/8/5
*/


import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class epitope1 extends JApplet implements ActionListener, ItemListener {

// Graphical User Interface components
JLabel gene1Label, gene2Label;
JTextArea textField1;
JButton button;
JLabel outputArea;

JRadioButton hla1, hla2, hla3;
Container Panel;
LayoutManager Layout;
ButtonGroup Background;


// Other variables used;
String hold;
String hold2;
int len1, len2,i,j,k,m,n,o;
String output, str1, str2;

public void init()
{
/* Instantiation */
Layout = new FlowLayout ();
hla1 = new JRadioButton ("AGTCA", true);
hla2 = new JRadioButton ("TCGAC");
hla3 = new JRadioButton ("ATGCA");
Background = new ButtonGroup();
str2="AGTCA";
/* Location */


/* Decoration */
hla1.setForeground (Color.blue);
hla2.setForeground (Color.blue);
hla3.setForeground (Color.blue);


/* Configuration */
Background.add (hla1);
Background.add (hla2);
Background.add (hla3);
hla1.addItemListener (this);
hla2.addItemListener (this);
hla3.addItemListener (this);



Container c = getContentPane();
c.setLayout (Layout);
c.add (hla1);
c.add (hla2);
c.add (hla3);
c.setBackground (Color.white);

gene1Label = new JLabel(" Enter Sequence ");
c.add(gene1Label);
here--->textField1 = new JTextArea(80, 150);
JScrollPane areaScrollPane = new JScrollPane(textField1);
areaScrollPane.setVerticalScrollBarPolicy(
JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
to here->areaScrollPane.setPreferredSize(new Dimension(250, 250));


button = new JButton("Submit");
button.addActionListener(this);
c.add(button);


outputArea = new JLabel();
c.add(outputArea);
outputArea.setText("This is output");
}


public void actionPerformed(ActionEvent evt)
{
showStatus("You clicked");str1 = textField1.getText();
output = str1.replaceAll(str2,
"<font color=\"yellow\">" + str2 + "</font>");
output = "<html>" + output + "</html>";
outputArea.setText(output);
}


public void itemStateChanged (ItemEvent e) {
ItemSelectable Source;
Source = e.getItemSelectable();

if (Source == hla1) {
str2 = "AGTCA";
} else if (Source == hla2) {
str2 = "TCGAC";
} else if (Source == hla3) {
str2 = "ATGCA";
}
}

}
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot change the interface langauge back in my Fedora 10 smartlion Linux - Newbie 3 07-01-2009 11:10 PM
LXer: Java news met with cautious optimism in free Java community LXer Syndicated Linux News 0 11-14-2006 10:21 PM
Arabic Langauge Is Not Supported? mesh2005 Linux - General 2 05-22-2006 02:09 AM
how to change langauge settings ? intuxicator Debian 2 04-24-2005 10:08 PM
Which langauge to learn? BongFish Programming 12 08-21-2003 08:30 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration