Problem :
I am having following warning message.
“The serializable class does not declare a static final serialversionuid field of type long”
I would like to understand and resolve the issue. Can somebody explain me this issue with simple words? I know what OOPs is
Please find below my code for your reference :
import java.awt.*;
import javax.swing.*;
public class HelloSwing extends JFrame {
JTextArea m_resultArea = new JTextArea(6, 30);
public HelloSwing() {
//... Set initial text, scrolling, and border.
m_resultArea.setText("Enter some more text to see scrollbars");
JScrollPane scrollingArea = new JScrollPane(m_resultArea);
scrollingArea.setBorder(BorderFactory.createEmptyBorder(10,5,10,5));
// Get the content pane, set layout, add to center
Container content = this.getContentPane();
content.setLayout(new BorderLayout());
content.add(scrollingArea, BorderLayout.CENTER);
this.pack();
}
public static void createAndViewJFrame() {
JFrame win = new HelloSwing();
win.setTitle("TextAreaDemo");
win.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
win.setVisible(true);
}
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable(){
public void run(){
createAndViewJFrame();
}
});
}
}