Home
/
JavaForum
/
Beginner
Infos
|
Features
|
Gold-Edition
|
Kundenservice
java
Übersicht
Forum
-
Beginner
-
Java allgemein
-
JDBC
-
JNI
-
Networking
-
Online-Ressourcen
-
Swing + AWT
-
XML
-
Meckerecke
Mitglieder
LOGIN
User oder E-Mail
Passwort
·
Passwort vergessen
·
Kostenlos anmelden
Information
Demo
Features
Im Vergleich
Anmeldung
SUCHE
Beiträge, Foren oder Verfasser finden:
Kundenservice
Impressum
Datenschutz
AGB
Status
2.974 User online
8 User eingeloggt
Beiträge
Beginner
Java allgemein
JDBC
JNI
Networking
Online-Ressourcen
Swing + AWT
XML
Meckerecke
Antworten
Neuer Beitrag
Gesamtdarstellung
Detaildarstellung
Einzeldarstellung
Threaddarstellung
Beitrag 1864 von 2963 (63%)
Autor
Marki
Datum
11.01.06, 23:00
Betreff
Klassenproblem
Hi Leute, ich hab folgendes Problem: Ich hab ein Problem mit meinen Klassenbezeichnungen.Dieses Problem ist schon öfter aufgetreten.
"The serializable class >Oberflaeche< does not declare a static final serialVersionUID field of type long"
Kann mir vielleicht jemand einen Tipp geben, was das Problem beseitigt
Programm:
import java.awt.*;
import java.awt.event.*;
public class Oberflaeche extends Frame
{
Oberflaeche fenster;
TextField text_seite_a, text_seite_d;
TextField text_seite_b, text_seite_c;
int breite = 500; int hoehe = 600;
Color hf = new Color(255,255,240);
Color vf = new Color(0xFF,0x00,0x7F);
int xmax,ymax;
Font schriftart;
public Oberflaeche()
{
fenster=this;
this.setSize(new Dimension(breite,hoehe));
setLocation(80,80);
this.setTitle("Umfang und Fläche");
this.setBackground(hf);
setLayout(null);
schriftart =new Font("Serif", Font.PLAIN, 16);
setFont(schriftart);
Button button_ende = new Button ("EXIT");
button_ende.setBounds(225,550,50,30);
add(button_ende);
Button button_berechne = new Button ("Berechne");
button_berechne.setBounds(112,500,70,25);
add(button_berechne);
Button button_neu = new Button ("Neu");
button_neu.setBounds(337,500,70,25);
add(button_neu);
feld();
button_ende.addActionListener
(new java.awt.event.ActionListener()
{ public void actionPerformed(ActionEvent e)
{ setVisible(false);
dispose();
System.exit(0);
}
});
button_berechne.addActionListener
(new java.awt.event.ActionListener()
{ public void actionPerformed(ActionEvent e)
{
Rechteck R1 = new Rechteck();
text_seite_c.setText(Double.toString(R1.berechneFlaeche(Double.parseDouble(text_seite_a.getText()),Double.parseDouble(text_seite_b.getText()))));
text_seite_d.setText(Double.toString(R1.berechneUmfang(Double.parseDouble(text_seite_a.getText()),Double.parseDouble(text_seite_b.getText()))));
}
});
button_neu.addActionListener
(new java.awt.event.ActionListener()
{ public void actionPerformed(ActionEvent e)
{ text_seite_a.setText("");
text_seite_b.setText("");
text_seite_c.setText("");
text_seite_d.setText("");
}
});
}
public void paint (Graphics g)
{
g.setColor(Color.black);
g.drawString("Programm zur Berechnung von Fläche und Umfang",95,60);
g.drawString("Seite a:",100,120);
g.drawString("Seite b:",350,120);
g.drawString("Umfang:",180,250);
g.drawString("Fläche:",180,300);
g.setColor(vf);
g.drawRect(10,10,xmax-20,ymax-20);
g.setColor(Color.orange);
g.fillOval(10,10,xmax-20,ymax-20);
}
public void feld(){
text_seite_a = new TextField();
text_seite_a.setColumns(25);
text_seite_a.setBounds(100,150,70,25);
text_seite_a.setText("");
add(text_seite_a);
text_seite_b = new TextField();
text_seite_b.setColumns(25);
text_seite_b.setBounds(350,150,70,25);
text_seite_b.setText("");
add(text_seite_b);
text_seite_c = new TextField();
text_seite_c.setColumns(25);
text_seite_c.setBounds(350,250,70,25);
text_seite_c.setText("");
add(text_seite_c);
text_seite_d = new TextField();
text_seite_d.setColumns(25);
text_seite_d.setBounds(350,350,70,25);
text_seite_d.setText("");
add(text_seite_d);
}
}
Diskussionsverlauf:
Re: Klassenproblem
Re: Klassenproblem
Re: Klassenproblem
Klassenproblem
Re: Klassenproblem
Auf diesen Beitrag antworten
Neuen Beitrag verfassen
Impressum
·
Datenschutz
·
AGB
·
Infos
·
Presse
Ein modernes Forum:
teamturn.com