WCM - Das österreichische Computer Magazin Forenübersicht
 

Zurück   WCM Forum > Rat & Tat > Programmierung

Programmierung Rat & Tat für Programmierer

Microsoft KARRIERECAMPUS

Antwort
 
Themen-Optionen Ansicht
Alt 13.11.2006, 23:21   #1
FritziNoob
bitte Mailadresse prüfen!
 
Registriert seit: 13.11.2006
Alter: 43
Beiträge: 1


Standard Bin zu blöd für Java

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) {
}
}
FritziNoob ist offline   Mit Zitat antworten
Alt 14.11.2006, 16:21   #2
hewlett
Inventar
 
Registriert seit: 08.11.2000
Alter: 42
Beiträge: 1.524


Standard

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
hewlett ist offline   Mit Zitat antworten
Alt 15.11.2006, 07:57   #3
deleted_150216
Inventar
 
Registriert seit: 28.08.2001
Ort: Österreich
Beiträge: 1.597


Standard

hmm, ich glaub ich weiss wo das problem mit dem main is - du hast keines
deleted_150216 ist offline   Mit Zitat antworten
Antwort


Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
 

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.

Gehe zu


Alle Zeitangaben in WEZ +2. Es ist jetzt 15:25 Uhr.


Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Forum SEO by Zoints
© 2009 FSL Verlag