calling a method

Posted on 2004-11-18
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
    LVL 92

    Accepted Solution

    public static void main (String [] args) {
       Administration admin = new Administration();
    LVL 92

    Expert Comment

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Suggested Solutions

    Title # Comments Views Activity
    Handling json in url param 1 33
    FizzBuzz challenge 9 63
    bigHeights  challenge 13 43
    Eclipse Neon and jdk 1.8.0 11 34
    After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now