KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have the warning message given in the title. I would like to understand and remove it. I found already some answers on this question but I do not understand these answers because of an overload with technical terms. Is it possible to explain this issue with simple words? P.S. I know what OOP is. I know what is object, class, method, field and instantiation. P.P.S. If somebody needs my code it is here: import java.awt.*; import javax.swing.*; public class HelloWorldSwing extends JFrame { JTextArea m_resultArea = new JTextArea(6, 30); //====================================================== constructor public HelloWorldSwing() { //... Set initial text, scrolling, and border. m_resultArea.setText("Enter 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 HelloWorldSwing(); win.setTitle("TextAreaDemo"); win.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); win.setVisible(true); } //============================================================= main public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable(){ public void run(){ createAndViewJFrame(); } }); } }
Tags (comma-separated)
Save Edits
Cancel