JOptionpane

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

Replies

Oldest  Newest  Rating
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?
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());
       j.add(item);
       j.setVisible(true);
   }
}
  • 1

Java / Android Development

106,986 followers
About

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

Links
Moderators
Bucky Roberts Administrator