Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How can I fix my jTextField convert automatically character or integer to the values of A,C,G,T  RSS feed

 
sam tomy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Campbell Ritchie
Marshal
Posts: 55799
164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I added code tags to your post. Always use them, and think how much better still it would have been with consistent indentation Look at line 22 for example.

I think you should go back to work out the algorithm for turning things into ACTG. Why have you got those Strings "00"? If they represent numbers, why are you not using numbers? Why haven't you got a Nucleotide class with four instances (that is called an Enumerated Type) A C T G? Show us what you think the algorithm should be for determining the four letters, then if you want to add something to a text component, you will find it quite easy with methods of text components.
Don't use += for Strings. Least of all in a loop, because you get slow execution. Use a StringBuilder for that sort of thing.
 
Campbell Ritchie
Marshal
Posts: 55799
164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A few minutes ago, I wrote:. . . A C T G . . .
You might want a second enum A C U G for RNA.
 
sam tomy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Thanks for your considering to my work here I just want to see if you go an idea of of to code the two prime keys with the DNA sequence thanks
 
Campbell Ritchie
Marshal
Posts: 55799
164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have already told you that you need to work out what the algorithm is. Tell us the algorithm and how you intend to implement it and we can comment about it.
 
sam tomy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sam tomy wrote:
 
Campbell Ritchie
Marshal
Posts: 55799
164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That does not help anybody at all.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!