Java වැඩ්ඩො

BoraluGoda

Member
Jan 28, 2011
486
114
0
::: GiRiPuRa :::
Healthy life hospital situated in Sri Lanka believes in medical expert care, advance technology and comfortable surrounding are paramount. They look at their services through their patients' eyes to create caring relationship with their patient and their families. Their having s desire to be a compassionate, efficient and dynamic private health care provider state-of-the-art technology at a reasonable cost.

Recently, with the growing number of patients coming to the OPD section and the developing strategic focus anticipated, the company thought of implementing a system which can help to support their customer service delivered by the front office.

The following is the interface design proposed for the system with minimum requirements.

27xi7ox.jpg


when the customer service agent of the hospital at the front desk enter the following details at the admission counter with details of the patient to OPD, they can click the option go to board which is depicted in the interface below. This is fixed in front of the doctor consultation/channel room and can be viewed by the patient.

25pl1mf.jpg



Machan la danna kenek mata meka karala denvda....Data structure wala Queue (en-queue & de-queue) thama use karanna oona..

Please machanla soon.....
 

ela

Well-known member
  • Jul 4, 2006
    6,425
    4,297
    113
    N/A
    eya online na neh machan, manz keeytda vithrada danne na neh enne ?

    ඒ කෙල්ලෙක්. මැසේජ් එකක් දාලා බලන්න අනම් මනම් විහිළු නොකර. :P රිප්ලයි කරයි. ප්‍රශ්ණෙ පුද්ගලිකව යවනවට වඩා ත්‍රෙඩ් එකේ ලින්ක් එක යැව්වෙවොත් අනෙක් අයටත් දෙයක් ඉගන ගන්න පුළුවන් නේද ? ඒ නිසා ත්‍රෙඩ් එකේ ලින්ක් එක යවලා උදව් ඉල්ලගන්න.
     

    BoraluGoda

    Member
    Jan 28, 2011
    486
    114
    0
    ::: GiRiPuRa :::
    oki ela machn thnx

    ඒ කෙල්ලෙක්. මැසේජ් එකක් දාලා බලන්න අනම් මනම් විහිළු නොකර. :P රිප්ලයි කරයි. ප්‍රශ්ණෙ පුද්ගලිකව යවනවට වඩා ත්‍රෙඩ් එකේ ලින්ක් එක යැව්වෙවොත් අනෙක් අයටත් දෙයක් ඉගන ගන්න පුළුවන් නේද ? ඒ නිසා ත්‍රෙඩ් එකේ ලින්ක් එක යවලා උදව් ඉල්ලගන්න.
     

    bigtop

    Member
    Jul 3, 2012
    1,512
    121
    0
    http://goo.gl/DOv6z
    මට ප්‍රශ්ණය තේරෙනවා නමුත් ඔයාට කොච්චර දුරට code ටික ඕනේද?
    SQL query වෙනකම් ඕනේද? queue මේක ටික use කරන්න

    මෙතන මම GUI එක draw කරන code ගහලා නෑ මොකද දැනටම ඔයා GUI එක හදලා ඉවර නිසා.
    මෙතන තියෙන patient ,it කියන variables local නැතුව global declare කරන්න ඒ කියන්නේ main method එකට පිටින්. ඊට පස්සේ get, set methods functions හදන්න පහළ දාලා තියෙන විදියට.
    get එකට call කරකොට ඒකේ parameters වලට patient ගේ විස්තර දෙන්න GUI එකේ ඉදලා.
    ඊට පස්සේ data retrieve කරනකොට one by one patientID එකේ ඉදලා ගන්න. මොකද Queue එකේ සාමාන්‍යයෙන් උඩින් තියෙන value එක තමයි මුලින්ම ගන්නේ ඉතින් පිළිවෙළට data retrieve කරන්න ඕනේ.


    Code:
    //important from java libraries 
    import java.until.Iterator;
    import java.until.Queue;
    import java.until.LinkedList;
    
    //declare global 
    Queue<String> patient = new LinkedList<String>();
    Iterator it = patient.iterator();
    
    //to inset data
    public void setdata(int patientID,String patientName,String patientAddress,String patientSikness,String doctorName)
    {
    
    patient.offer(Integer.toString(patientID));
    patient.offer(patientName);
    patient.offer(patientAddress);
    patient.offer(patientSikness);
    patient.offer(doctorName);
    
    }
    
    
    //to retrieve data
    public string getPatientID()
    {
    string patientId = (String)patient.poll();
    return patientId ;
    
    }
    
    public string getPatientName()
    {
    string patientName = (String)patient.poll();
    return patientName ;
    
    
    }
    public string getPatientAddress()
    {
    string patientAddress = (String)patient.poll();
    return patientAddress
    
    
    }
    public string getPatientSikness()
    {
    string patientSikness = (String)patient.poll();
    return patientSikness;
    
    
    }
    public string getDoctorName()
    {
    string doctorName = (String)patient.poll();
    return doctorName;
    
    }
     
    • Like
    Reactions: BoraluGoda

    ela

    Well-known member
  • Jul 4, 2006
    6,425
    4,297
    113
    N/A
    මට ප්‍රශ්ණය තේරෙනවා නමුත් ඔයාට කොච්චර දුරට code ටික ඕනේද?
    SQL query වෙනකම් ඕනේද? queue මේක ටික use කරන්න

    මෙතන මම GUI එක draw කරන code ගහලා නෑ මොකද දැනටම ඔයා GUI එක හදලා ඉවර නිසා.
    මෙතන තියෙන patient ,it කියන variables local නැතුව global declare කරන්න ඒ කියන්නේ main method එකට පිටින්. ඊට පස්සේ get, set methods functions හදන්න පහළ දාලා තියෙන විදියට.
    get එකට call කරකොට ඒකේ parameters වලට patient ගේ විස්තර දෙන්න GUI එකේ ඉදලා.
    ඊට පස්සේ data retrieve කරනකොට one by one patientID එකේ ඉදලා ගන්න. මොකද Queue එකේ සාමාන්‍යයෙන් උඩින් තියෙන value එක තමයි මුලින්ම ගන්නේ ඉතින් පිළිවෙළට data retrieve කරන්න ඕනේ.


    Code:
    //important from java libraries 
    import java.until.Iterator;
    import java.until.Queue;
    import java.until.LinkedList;
    
    //declare global 
    Queue<String> patient = new LinkedList<String>();
    Iterator it = patient.iterator();
    
    //to inset data
    public void setdata(int patientID,String patientName,String patientAddress,String patientSikness,String doctorName)
    {
    
    patient.offer(Integer.toString(patientID));
    patient.offer(patientName);
    patient.offer(patientAddress);
    patient.offer(patientSikness);
    patient.offer(doctorName);
    
    }
    
    
    //to retrieve data
    public string getPatientID()
    {
    string patientId = (String)patient.poll();
    return patientId ;
    
    }
    
    public string getPatientName()
    {
    string patientName = (String)patient.poll();
    return patientName ;
    
    
    }
    public string getPatientAddress()
    {
    string patientAddress = (String)patient.poll();
    return patientAddress
    
    
    }
    public string getPatientSikness()
    {
    string patientSikness = (String)patient.poll();
    return patientSikness;
    
    
    }
    public string getDoctorName()
    {
    string doctorName = (String)patient.poll();
    return doctorName;
    
    }

    :D
     

    BoraluGoda

    Member
    Jan 28, 2011
    486
    114
    0
    ::: GiRiPuRa :::
    මෙහෙමයි අක්කෙ අපිට සර් පොඩි පොඩි සාම්පල් කෝඩ් ටිකක් දුන්නා(LinkList Class, Link Class, QueueList Class). අපිට DATABASE නම් යූස් කරන්න ඔන නැ න කියුවා.

    Link Class

    Code:
    public class Link{
        public double data;
        public Link nextLink;
    
        //Link constructor
        public Link(double d) {
                data = d;
        }
    
        //Print Link data
        public void printLink() {
                System.out.print("{" + data + "} ");
        }
    }


    LinkList Class

    Code:
    class LinkList {
        private Link first;
        private Link last;
    
        public LinkList() {
            first = null;
            last = null;
        }
    
        public boolean isEmpty() {
            return first == null;
        }
    
    
        public void insertlast(double d2) {
            Link link = new Link(d2);
    	if(isEmpty()){
               first = link;
    	}else{
    	   last.nextLink = link;
    	}
    	last = link;
        }
    
        public double deleteFirst() {
            double temp = first.data;
    	if(first.nextLink == null){
    	   last = null;
    	}
    	first = first.nextLink;
    	return temp;
        }
    
        public void printList(){
            Link currentLink = first;
            System.out.print("List: ");
            while(currentLink != null) {
               currentLink.printLink();
               currentLink = currentLink.nextLink;
            }
            System.out.println("");
        }
    }

    QueueList Class

    Code:
    public class QueueList{
       private LinkList theList;
       
    
       public QueueList(){
          theList = new LinkList();  
       }
    
       public boolean isEmpty(){
          return theList.isEmpty();
       }
    
       public void enqueue(double d){
          theList.insertlast(d);
       }
       
       public double dequeue(){
          return theList.deleteFirst();
       }
    
       public void displayQueue(){
          System.out.println("Queue (Front ---> Rear): ");
          theList.printList();
       }
    }

    අපි මෙ කෝඩින් කරෙ Text Documents වල සහ කම්පයිල් කරෙ Command Prompt එකේ.
    තරහ නැතුව මට Three Tire Architecture එකට මෙ (Net Beans) Program එක හදල දෙන්න පුලුවන්ද.
    ගොඩක් පින් සිද්ද වෙනවා.


    මට ප්‍රශ්ණය තේරෙනවා නමුත් ඔයාට කොච්චර දුරට code ටික ඕනේද?
    SQL query වෙනකම් ඕනේද? queue මේක ටික use කරන්න

    මෙතන මම GUI එක draw කරන code ගහලා නෑ මොකද දැනටම ඔයා GUI එක හදලා ඉවර නිසා.
    මෙතන තියෙන patient ,it කියන variables local නැතුව global declare කරන්න ඒ කියන්නේ main method එකට පිටින්. ඊට පස්සේ get, set methods functions හදන්න පහළ දාලා තියෙන විදියට.
    get එකට call කරකොට ඒකේ parameters වලට patient ගේ විස්තර දෙන්න GUI එකේ ඉදලා.
    ඊට පස්සේ data retrieve කරනකොට one by one patientID එකේ ඉදලා ගන්න. මොකද Queue එකේ සාමාන්‍යයෙන් උඩින් තියෙන value එක තමයි මුලින්ම ගන්නේ ඉතින් පිළිවෙළට data retrieve කරන්න ඕනේ.


    Code:
    //important from java libraries 
    import java.until.Iterator;
    import java.until.Queue;
    import java.until.LinkedList;
    
    //declare global 
    Queue<String> patient = new LinkedList<String>();
    Iterator it = patient.iterator();
    
    //to inset data
    public void setdata(int patientID,String patientName,String patientAddress,String patientSikness,String doctorName)
    {
    
    patient.offer(Integer.toString(patientID));
    patient.offer(patientName);
    patient.offer(patientAddress);
    patient.offer(patientSikness);
    patient.offer(doctorName);
    
    }
    
    
    //to retrieve data
    public string getPatientID()
    {
    string patientId = (String)patient.poll();
    return patientId ;
    
    }
    
    public string getPatientName()
    {
    string patientName = (String)patient.poll();
    return patientName ;
    
    
    }
    public string getPatientAddress()
    {
    string patientAddress = (String)patient.poll();
    return patientAddress
    
    
    }
    public string getPatientSikness()
    {
    string patientSikness = (String)patient.poll();
    return patientSikness;
    
    
    }
    public string getDoctorName()
    {
    string doctorName = (String)patient.poll();
    return doctorName;
    
    }
     

    bigtop

    Member
    Jul 3, 2012
    1,512
    121
    0
    http://goo.gl/DOv6z
    Three Tier Architecture කියන්නේ GUI Layer එක, Business Layer එක, Database Layer එක තියෙන Model එකකටයි. මේකේ අනිවාර්‍යයෙන්ම Database එකක් තියෙන්න ඕනේ නැත්නම් ඒක Three Tier Architecture විදියක් නෑ නේ. කොහොම හරි මම Queue එකක් දාලා Data Insert Three Tier Architecture එකක් හැදුවා. එතකොට මේකේ Data Insert වෙන්නෙත් සහා Database එක හැටියට ක්‍රියාකරන්නෙත් Queue එකයි/ටයි.
    ඉතුරු ටික ඔයා මේ විදියට බලාගෙන කරන්න. මම ඔක්කොම කරලා දුන්නම ඔයාට ඉගෙන ගන්න දෙයක් ඉතුරු වෙන්නෙ නෑ නේ. ඉතින් ඒක නිසා මේ ටික හොදට refer කරන්න.
    මම ලියපු එක එහෙමම Copy Paste කරන්න එපා. ඒක හොදට බලාගන්න ඊට පස්සේ තමන්ට පුලුවන් විදියට මේ Code එක refer කරන ගමන් තනියෙන්ම code එක ලියන්න. ඒ විදියට තමයි ඉගෙන ගන්න පුලුවන්.
    ^.^


    ashjFrame Class එක
    Code:
    import java.util.*;
    import java.awt.*;
    import javax.swing.*;
    
    public class ashjFrame extends JFrame{
    
    
            public ashjFrame()
            {
                //==================Initialize the attributes of the jFrame==================
                setTitle("Patient Management System");
                setMaximizedBounds(new Rectangle(640,480));
                setBounds(0,0,640,480);
                setResizable(false);
                setDefaultCloseOperation(EXIT_ON_CLOSE);
                JPanel panelWindow = new ashjPanel();
                this.add(panelWindow);
            }
    
    
            public static void main(String args[])
            {
                ashjFrame frameWindow = new ashjFrame();
                frameWindow.showFrame();
            }
    
    
            public void showFrame()
            {
                this.setVisible(true);
            }
    
    }

    ashjPanel Class එක
    Code:
    import java.util.*;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    
    public class ashjPanel extends JPanel implements ActionListener{
    
    //=============Initialize Buttons,Labels,Textboxes================
    JButton btnGotoBoard,btnAdmission;
    JLabel lblPatientID,lblPatientName,lblPatientAddress,lblPatientSickness,lblDoctorName,lblSystemName;
    JLabel lblSpace;
    JTextArea txtaPatientAddress;
    JTextField txtfPatientID,txtfPatientName,txtfDoctorName,txtfPatientSickness;
    int patientId;
    String PatientName,PatientSickness,DoctorName,PatientAddress;
    
        public ashjPanel() {
    
            //==========Initialize the Grid and Panel==============
            GridBagLayout gridArea = new GridBagLayout();
            this.setLayout(gridArea);
    
    
            //==========Initialize the Components==============
            btnGotoBoard = new JButton("Go To Board");
            btnAdmission = new JButton("Admission");
            lblPatientID = new JLabel("Patient ID");// <--
            lblPatientName =  new JLabel("Patient Name");
            lblPatientAddress = new JLabel("Patient Address");
            lblPatientSickness = new JLabel("Patient Sickness");
            lblDoctorName = new JLabel("Doctor Name");
            lblSystemName = new JLabel("Patient Detail Enter Wizard");
            lblSpace = new JLabel(" ");// <--
            txtfPatientID = new JTextField(10);
            txtfPatientName = new JTextField(19);
            txtaPatientAddress = new JTextArea(8,38);
            txtfDoctorName = new JTextField(38);
            txtfPatientSickness = new JTextField(38);
    
            //===========Attach ActionsEvents to Components======
            btnGotoBoard.addActionListener(this);
            btnAdmission.addActionListener(this);
    
            //==========Add Components onto the Panel==============
            this.add(lblSpace,setGridAttributes(0,0,0,0,GridBagConstraints.WEST));
            this.add(lblPatientID,setGridAttributes(2,2,1,1,GridBagConstraints.EAST));
            this.add(txtfPatientID,setGridAttributes(3,2,1,1,GridBagConstraints.WEST));
            this.add(lblSpace,setGridAttributes(4,2,1,1,GridBagConstraints.WEST));//for the Blank
            this.add(lblPatientName,setGridAttributes(5,2,1,1,GridBagConstraints.EAST));
            this.add(txtfPatientName,setGridAttributes(6,2,1,1,GridBagConstraints.WEST));// <-- END
            this.add(lblPatientAddress,setGridAttributes(2,5,1,1,GridBagConstraints.EAST));
            this.add(txtaPatientAddress,setGridAttributes(3,5,5,3,GridBagConstraints.WEST));// <-- END
            this.add(lblPatientSickness,setGridAttributes(2,10,1,1,GridBagConstraints.EAST));
            this.add(txtfPatientSickness,setGridAttributes(3,10,5,1,GridBagConstraints.WEST));// <-- END
            this.add(lblDoctorName,setGridAttributes(2,13,1,1,GridBagConstraints.EAST));
            this.add(txtfDoctorName,setGridAttributes(3,13,5,1,GridBagConstraints.WEST));// <-- END
            this.add(btnAdmission,setGridAttributes(4,16,2,1,GridBagConstraints.WEST));
            this.add(btnGotoBoard,setGridAttributes(6,16,1,1,GridBagConstraints.WEST));// <-- END
    
        }
    
        //==========Specify the Attributes of the Gridbagconstraints==============
        private GridBagConstraints setGridAttributes(int edgeGridX,int edgeGridY,int cellGridHorizontal,int cellGridVertical,int anchor)
        {
            GridBagConstraints gridbgArea = new GridBagConstraints();
            gridbgArea.insets = new Insets(1,1,1,1);
            gridbgArea.ipadx = 0;
            gridbgArea.ipady = 0;
            gridbgArea.gridx = edgeGridX;
            gridbgArea.gridy = edgeGridY;
            gridbgArea.gridheight = cellGridVertical;
            gridbgArea.gridwidth = cellGridHorizontal;
            gridbgArea.anchor = anchor;
            return gridbgArea;
        }
    
    
        //================================Event Handler=============================
        public void actionPerformed(ActionEvent action)
        {
            Object sourceObj = action.getSource();
    
            if(sourceObj == btnGotoBoard)
            {
                //Type your Codes Here asscoaited for GotoBoard.
            }
    
            else if(sourceObj == btnAdmission)
            {
                if(txtfPatientID.getText().equalsIgnoreCase("") || txtfPatientName.getText().equalsIgnoreCase("")
                     || txtfPatientSickness.getText().equalsIgnoreCase("")
                     || txtfDoctorName.getText().equalsIgnoreCase("")
                     || txtaPatientAddress.getText().equalsIgnoreCase(""))
                {
                    JOptionPane.showMessageDialog(null,"Please Fill the Empty Boxes to Proceed.");
                }
                else
                {
                    patientId = Integer.parseInt(txtfPatientID.getText());
                    PatientName = txtfPatientName.getText();
                    PatientSickness = txtfPatientSickness.getText();
                    DoctorName = txtfDoctorName.getText();
                    PatientAddress = txtaPatientAddress.getText();
    
                    ashGetSet getsetObj = new ashGetSet();
                    getsetObj = new ashBusiness().receiveValues(patientId,PatientName,PatientAddress,PatientSickness,DoctorName);
    
                    if(getsetObj.getResult() == true)
                    {
                        JOptionPane.showMessageDialog(null,"Entering Sucessed");
                    }else
                    {
                        JOptionPane.showMessageDialog(null,"Entering Failed");
                    }
                }
            }
    
        }
    
    
    }
    ashBusiness Class එක
    Code:
    import java.util.*;
    import javax.swing.*;
    
    public class ashBusiness {
    
        //==============Leave the Default Constructor Alone========== ;)
        public ashBusiness() {
        }
    
        public ashGetSet receiveValues(int patientID,String patientName,String patientAddress,String patientSickness,String doctorName)
        {
            ashGetSet setGetObj = new ashGetSet();
            ashDatabase dbObj = new ashDatabase();
            setGetObj.setResult(dbObj.insertQueue(patientID,patientName,patientAddress,patientSickness,doctorName));
            return setGetObj;
        }
    
    }
    ashGetSet Class එක
    Code:
    public class ashGetSet {
    
            //==============Leave the Default Constructor Alone========== ;)
            public ashGetSet(){
            }
    
            //=============Variable Declaration=============
            private int patientID;
            private String patientName,patientAddress,patientSickness,doctorName;
            private boolean boolResult;
    
    
            //=============Set Patient Info=================
            public void setPatientInfo(int patientID,String patientName,String patientAddress,String patientSickness,String doctorName)
            {
                patientID = patientID;
                patientName = patientName;
                patientAddress = patientAddress;
                patientSickness = patientSickness;
                doctorName = doctorName;
            }
    
            //===========Get/Set Result=====================
            public void setResult(boolean result)
            {
                boolResult = result;
            }
    
            public boolean getResult()
            {
                return boolResult;
            }
    
            //=============Get Patient Info=================
            public int getPatientId()
            {
                return patientID;
            }
    
            public String getPatientName()
            {
                return patientName;
            }
    
            public String getPatientAddress()
            {
                return patientAddress;
            }
    
            public String getpatientSickness()
            {
                return patientSickness;
            }
    
            public String getdoctorName()
            {
                return doctorName;
            }
    }
    ashDatabase Class එක
    Code:
    import java.util.*;
    import java.util.Iterator;
    import java.util.Queue;
    import java.util.LinkedList;
    
    
    
    public class ashDatabase{
    
        //==========Queue List for Storing Data============
        Queue<String> patient = new LinkedList<String>();
        Iterator it = patient.iterator();
    
        //=================Insert Values and Retrieve the Response Boolean Value==============
        public boolean insertQueue(int patientID,String patientName,String patientAddress,String patientSickness,String doctorName)
        {
            patient.offer(Integer.toString(patientID));
            patient.offer(patientName);
            patient.offer(patientAddress);
            patient.offer(patientSickness);
            patient.offer(doctorName);
    
            if(5 == patient.size())
            {
                return true; //Entering Sucessed
            }
            else
            {
                return false; //Entering Failed
            }
    
        }
    
    
    /*
        public string getPatientID()
        {
            string patientId = (String)patient.poll();
            return patientId ;
    
        }
    
        public string getPatientName()
        {
            string patientName = (String)patient.poll();
            return patientName ;
    
    
        }
        public string getPatientAddress()
        {
            string patientAddress = (String)patient.poll();
            return patientAddress
    
    
        }
        public string getPatientSikness()
        {
            string patientSikness = (String)patient.poll();
            return patientSikness;
    
    
        }
        public string getDoctorName()
        {
            string doctorName = (String)patient.poll();
            return doctorName;
    
        }
        */
    }
     

    BoraluGoda

    Member
    Jan 28, 2011
    486
    114
    0
    ::: GiRiPuRa :::
    Oyage udawwen man wede lassnata kara gaththa..... mata a tika table ekak view karaganna oona... man a code 1 kara but weda karanne na neh.. :rolleyes: :rolleyes: :rolleyes:

    Three Tier Architecture කියන්නේ GUI Layer එක, Business Layer එක, Database Layer එක තියෙන Model එකකටයි. මේකේ අනිවාර්‍යයෙන්ම Database එකක් තියෙන්න ඕනේ නැත්නම් ඒක Three Tier Architecture විදියක් නෑ නේ. කොහොම හරි මම Queue එකක් දාලා Data Insert Three Tier Architecture එකක් හැදුවා. එතකොට මේකේ Data Insert වෙන්නෙත් සහා Database එක හැටියට ක්‍රියාකරන්නෙත් Queue එකයි/ටයි.
    ඉතුරු ටික ඔයා මේ විදියට බලාගෙන කරන්න. මම ඔක්කොම කරලා දුන්නම ඔයාට ඉගෙන ගන්න දෙයක් ඉතුරු වෙන්නෙ නෑ නේ. ඉතින් ඒක නිසා මේ ටික හොදට refer කරන්න.
    මම ලියපු එක එහෙමම Copy Paste කරන්න එපා. ඒක හොදට බලාගන්න ඊට පස්සේ තමන්ට පුලුවන් විදියට මේ Code එක refer කරන ගමන් තනියෙන්ම code එක ලියන්න. ඒ විදියට තමයි ඉගෙන ගන්න පුලුවන්.
    ^.^
     

    BoraluGoda

    Member
    Jan 28, 2011
    486
    114
    0
    ::: GiRiPuRa :::
    Code:
    public Admission_Window() {
            initComponents();
            Object columnNames[] = { "ID", "Patient Name", "Patient Address", "Sickness", "Doctor"};    
            Object rowName[][] = new Object[0][5];
            tblDetails.setModel(new javax.swing.table.DefaultTableModel(rowName,columnNames));
        }

    Code:
    private void tblFill(){
             Object columnNames[] = { "ID", "Patient Name", "Patient Address", "Sickness", "Doctor"};   
             Object rowName[][] = new Object[pQueue.getSize()][5];
             for(int i=0;i<pQueue.getSize();i++){
    	    Patient ptnObj = pQueue.get(i);
    	    rowName[i][0]=String.valueOf(ptnObj.getmID());
                rowName[i][1]=String.valueOf(ptnObj.getmPName());
                rowName[i][2]=String.valueOf(ptnObj.getmAddress());
                rowName[i][3]=String.valueOf(ptnObj.getmSickness());
                rowName[i][4]=String.valueOf(ptnObj.getmDName());
    	 }
      
             tblDetails.setModel(new javax.swing.table.DefaultTableModel(rowName,columnNames));
    
        }

    Code:
    package DataAccess_Layer;
    
    import Business_Layer.Patient;
    
    
    public class Queue {
       private Patient queueArray[];
       private int maxSize;
       private int front;  
       private int rear; 
       private int nItems; 
       private int index;
    
       public Queue (int size){
           maxSize = size;	
           queueArray = new Patient[maxSize];
           front=0;
           rear = -1;
           nItems = 0;
       }
       
       public void enqueue(Patient x){
          if(rear == maxSize-1){
    	 rear = -1;
          }
    
          queueArray[++rear] = x;
          nItems++;
       }
    
       public Patient dequeue(){
          Patient temp = queueArray[front++];
          if(front == maxSize){
              front = 0;
          }
          nItems--;
          return temp;      
       }
    
       public Patient peekFront(){
          return queueArray[front];
       }
       public boolean isEmpty(){
           return (nItems == 0);
       }
    	
       public boolean isFull(){
           return (nItems == maxSize);
       }
       
       public int getSize(){
          return this.index;
       }
       
       public Patient get(int index){
          return this.queueArray[index];
       }
        
    }

    Code:
    private void btnAddmissionActionPerformed(java.awt.event.ActionEvent evt) {                                              
            int pID = Integer.parseInt(txtPID.getText());
            String pName = txtPName.getText();
            String pAddress = txtAddress.getText();
            String pSickness = txtSickness.getText();
            String dName = txtDName.getText();
            Patient ptn = new Patient(pID, pName, pAddress, pSickness, dName);
            pQueue.enqueue(ptn);
            tblFill();
        }