0

My Graphics Program does not run by showing no output why so

9th May 2020, 7:01 AM
Krish
Krish - avatar
5 Respuestas
0
Post your code
9th May 2020, 7:05 AM
Mustafha Ahmad
Mustafha Ahmad - avatar
0
import java.awt.*; import javax.swing.JTextArea; import javax.swing.*; class abc extends JFrame { JTextArea ta; abc() { Container c=getContentPane(); c.setLayout(new BorderLayout()); ta=new JTextArea(); c.add(ta); } public static void main() { abc j=new abc(); j.setSize(400,400); j.setVisible(true); j.setTitle("My First Frame"); } }
9th May 2020, 7:07 AM
Krish
Krish - avatar
0
here' the code
9th May 2020, 7:07 AM
Krish
Krish - avatar
0
Try this way.... I think it may help.. JTextArea ta; abc() { setSize(400,400); setVisible(true); setTitle("My First Frame"); Container c=this.getContentPane(); c.setLayout(new BorderLayout()); ta=new JTextArea(); c getContentPane().add(ta); } public static void main() { abc j=new abc(); }
9th May 2020, 8:25 AM
Jayakrishna 🇮🇳
0
It didnt work
9th May 2020, 10:26 AM
Krish
Krish - avatar