calling a method

Posted on 2004-11-18
Medium Priority
Last Modified: 2012-05-05
i have this file and i want to call the method makeGUI from the main method what is the exact code to do this

import java.awt.*;
import javax.swing.*;
public class Administration
      JFrame f;
      JTextField tittle, author, publisher, year, isbn, category, book_number, unit_price;
      JButton search, update, clear, add;
      JPanel panel, tPanel;

public Administration()

               void makeGUI(){
                JFrame f = new JFrame ("Main Frame");
                f.setSize(350, 250);

panel = new JPanel(new GridBagLayout());

panel.add(new JButton("SEARCH"),search);
panel.add(new JButton("UPDATE"),update);
panel.add(new JButton("CLEAR"),clear);
panel.add(new JButton("ADD"),add);


public static void main (String [] args) {
}//administration main
Question by:lucinda77
  • 2
LVL 92

Accepted Solution

objects earned 200 total points
ID: 12620752
public static void main (String [] args) {
   Administration admin = new Administration();
LVL 92

Expert Comment

ID: 12620755
no need to call makeGUI() from your main as the constructor already calls it.

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses
Course of the Month13 days, 18 hours left to enroll

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question