![]() |
![]() |
|
![]() |
![]() |
|
Registrieren | Hilfe/Forumregeln | Benutzerliste | Kalender | Suchen | Heutige Beiträge | Alle Foren als gelesen markieren |
Programmierung Rat & Tat für Programmierer |
![]() |
|
Themen-Optionen | Ansicht |
![]() |
#1 |
bitte Mailadresse prüfen!
Registriert seit: 13.11.2006
Alter: 43
Beiträge: 1
|
![]() Kann mir irgendwer bei dem Problem helfen und das zum Laufen zu bringen ich habe beim "main" noch ein paar Probleme.
import javax.swing.*; import javax.swing.text.*; import javax.swing.border.*; import java.awt.*; import java.awt.event.*; // WildTypeDNAPanel public class WildTypeDNAPanel extends NextPanel { JTextArea textArea; public WildTypeDNAPanel(NextPanelListener n) { super(n); textArea = new JTextArea(); textArea.setLineWrap(true); textArea.setText("");//"CTCGAGCGACCGAATTGACCGAACGGTCATGGCTTCCCTTGGCTAGTGC AGTGGCCCAAGTGCTTACTACTAGGTGGGAACCCAGTCTGGCACTTACGC ACGTGTACAGAA"); // Add it all to the panel thePanel.setLayout(new BorderLayout()); thePanel.add(new JLabel("Please enter your wild-type DNA sequence below"/*, starting in-frame"*/), BorderLayout.NORTH); thePanel.add(textArea, BorderLayout.CENTER); textArea.setBorder(BorderFactory.createLineBorder( Color.BLACK, 1)); } public void actionPerformed(ActionEvent a) { String command = a.getActionCommand(); if(command.equals(backString)) listener.backClicked(); else if(command.equals(nextString)) { String dnaSeq = getDNASequence(); if(dnaSeq == null) new NotificationPopup("Invalid DNA Sequence - can only contain " + "'A', 'C', 'G', or 'T'"); /*else if(dnaSeq.length() % 3 != 0) new NotificationPopup("Invalid DNA Sequence - must contain only " + "complete codons (multiples of three)");*/ else listener.nextClicked(dnaSeq, null, true); } } String getDNASequence() { String text = textArea.getText().toUpperCase().trim(); StringBuffer formattedSequence = new StringBuffer(""); for(int i = 0; i < text.length(); i++) { char ch = text.charAt(i); if(Character.isWhitespace(ch) == false) { if(ch == 'A' || ch == 'C' || ch == 'G' || ch == 'T') formattedSequence.append(ch); else return null; } } return formattedSequence.toString(); } // Don't need to do anything after the Welcome window's next button is clicked public void hasFocus(String results1, String results2, boolean defaultOutputFormat) { } } |
![]() |
![]() |
![]() |
#2 |
Inventar
![]() Registriert seit: 08.11.2000
Alter: 42
Beiträge: 1.524
|
![]() mach dir deine Hausübung selbst!
Manche Leute werden immer dreister! ![]()
____________________________________
H.E.W.L.E.T.T.: Hydraulic Electronic Worker Limited to Exploration and Terran Troubleshooting |
![]() |
![]() |
![]() |
#3 |
Inventar
![]() Registriert seit: 28.08.2001
Ort: Österreich
Beiträge: 1.597
|
![]() hmm, ich glaub ich weiss wo das problem mit dem main is - du hast keines
![]() |
![]() |
![]() |
![]() |
Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1) | |
Themen-Optionen | |
Ansicht | |
|
|