Witam
Dlaczego nie wyświetla mi się textArea w takim fragmencie kodu
textArea=TextARea();
textArea.serBounds(10,79,405,137);
JScrollPane scroll= new JScrollPane(textArea);
contentPane.adr(scroll);
Witam
Dlaczego nie wyświetla mi się textArea w takim fragmencie kodu
textArea=TextARea();
textArea.serBounds(10,79,405,137);
JScrollPane scroll= new JScrollPane(textArea);
contentPane.adr(scroll);
Może przez literówki. Trudno wyczuć które są w kodzie a które tylko tutaj ale jest ich sporo.
Jak tworzysz JTextArea to nie zapomnij o new.
Wklej może całość kodu.
Kod:
textArea = new JTextArea();
textArea.setBounds(10, 79, 405, 137);
JScrollPane scroll= new JScrollPane(textArea);
contentPane.add(scroll);
Wytrzeźwiałeś? :) Metodę setBounds wywołaj na rzecz obiektu scroll, a nie textArea.