0 Yellow flash · May 30, 2015
JOptionpane is a class or an object ? if it is class so we can access a method a from class ? i thought we can only access a method by its object

Post a Reply


Oldest  Newest  Rating
0 Yellow flash · June 12, 2015
yeah i did nt know that we can access a static method with class so i got that doubt . thanx for u r help nd if u did nt mind another favor 

i did nt have a problem just a doubt . i did nt understand the line "setLayout(new Flowlayout);" i am thinking dat "new FlowLayout()" is a constructor rht? nd setLayout is method from JFrame rht. so we are a able to pass a constructor to the method?? if yes how can i make my method to accept a constructor? nd in this code i got doubt 

import java.awt.FlowLayout;
import javax.swing.JFrame;
import javax.swing.JTextField;

public class frame {

   public static void main(String args[])

       JTextField item =new JTextField("i am a text field");
       JFrame j =new JFrame("this is title");
       j.setLayout(new FlowLayout());
0 Yellow flash · June 14, 2015
thanx nd by the way just asking . if you do nt mind do u wanna share the above full program?
  • 1

Java / Android Development


Very popular language used to create desktop applications, website applets, and Android apps.

Bucky Roberts Administrator