Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
package kalkulacka;

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


public class Lalala extends JFrame {
	
	
	
	private JTextField vloz1;
	private JButton stlac; 
	private JTextField vloz2; 
	private JLabel label_vysledok; 
	private JPanel lajna1; 
	private JPanel lajna2; 
	
	public Lalala(){
		super ("Kalkulacka");
		FlowLayout layout = new FlowLayout();
		setLayout(layout);
		
		lajna1 = new JPanel();
		lajna1.setBackground(Color.blue);
		add(lajna1);
		
		lajna2 = new JPanel();
		lajna2.setBackground(Color.LIGHT_GRAY);
		add(lajna2);
		
		vloz1 = new JTextField(); 
		lajna1.add(vloz1);
		vloz2 = new JTextField(); 
		lajna1.add(vloz2);
		stlac = new JButton();
		lajna1.add(stlac);
		
		label_vysledok = new JLabel();
		lajna2.add(label_vysledok);
	}
}


C#
package kalkulacka;

import javax.swing.JFrame;

public class Kalkulacka {

	public static void main(String[] args) {
		Lalala okno = new Lalala(); 
		okno.setVisible(true);
		okno.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		okno.setLocationRelativeTo(null);
		
		

	}

}


What I have tried:

One code is a GUI (Lalala) of kalkulacka. I tried add a parameters to class Lala methods. Then I tried change position of setBackground and other methods. Nothing worked. Eclipse saying me this problem:
C#
The serializable class Lalala does not declare a static final serialVersionUID field of type long
but I dont know what Eclipse mean..

I am solving this problem for two hour without a result.
Posted
Updated 13-Nov-16 22:10pm
v2

1 solution

Just add the following line in your class definition:
Java
private static final long serialVersionUID = 1L;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900