Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
හොඳ, දැන්වීම්-රහිත (ad-free) ආයුර්වේද ඇප් එකක් සොයා ගැනීමට නොහැකි වූ නිසා, මමම එකක් නිර්මාණය කළා
kitchen_discussions
Updated:
Today at 2:34 AM
Ad icon
Iptv
musicking
Updated:
Sunday at 9:52 AM
Ad icon
ZTE MF283U 4G Unlocked Router (Used)
ayanthamaxi
Updated:
Jul 19, 2026
ලංකාවේ හොඳම උපකාරක පන්ති සහ ගුරුවරුන් එකම තැනකින් - TopTuition.lk
dulithapathum
Updated:
Jul 18, 2026
Colombo
RidhMathraa ’26 🎶✨
Tmadhusanka
Updated:
Jul 15, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Help
Java වැඩ්ඩො
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="BoraluGoda" data-source="post: 13257764" data-attributes="member: 332053"><p>[CODE]</p><p>public Admission_Window() {</p><p> initComponents();</p><p> Object columnNames[] = { "ID", "Patient Name", "Patient Address", "Sickness", "Doctor"}; </p><p> Object rowName[][] = new Object[0][5];</p><p> tblDetails.setModel(new javax.swing.table.DefaultTableModel(rowName,columnNames));</p><p> }</p><p>[/CODE]</p><p></p><p>[CODE]</p><p>private void tblFill(){</p><p> Object columnNames[] = { "ID", "Patient Name", "Patient Address", "Sickness", "Doctor"}; </p><p> Object rowName[][] = new Object[pQueue.getSize()][5];</p><p> for(int i=0;i<pQueue.getSize();i++){</p><p> Patient ptnObj = pQueue.get(i);</p><p> rowName[i][0]=String.valueOf(ptnObj.getmID());</p><p> rowName[i][1]=String.valueOf(ptnObj.getmPName());</p><p> rowName[i][2]=String.valueOf(ptnObj.getmAddress());</p><p> rowName[i][3]=String.valueOf(ptnObj.getmSickness());</p><p> rowName[i][4]=String.valueOf(ptnObj.getmDName());</p><p> }</p><p> </p><p> tblDetails.setModel(new javax.swing.table.DefaultTableModel(rowName,columnNames));</p><p></p><p> }[/CODE]</p><p></p><p>[CODE]</p><p>package DataAccess_Layer;</p><p></p><p>import Business_Layer.Patient;</p><p></p><p></p><p>public class Queue {</p><p> private Patient queueArray[];</p><p> private int maxSize;</p><p> private int front; </p><p> private int rear; </p><p> private int nItems; </p><p> private int index;</p><p></p><p> public Queue (int size){</p><p> maxSize = size; </p><p> queueArray = new Patient[maxSize];</p><p> front=0;</p><p> rear = -1;</p><p> nItems = 0;</p><p> }</p><p> </p><p> public void enqueue(Patient x){</p><p> if(rear == maxSize-1){</p><p> rear = -1;</p><p> }</p><p></p><p> queueArray[++rear] = x;</p><p> nItems++;</p><p> }</p><p></p><p> public Patient dequeue(){</p><p> Patient temp = queueArray[front++];</p><p> if(front == maxSize){</p><p> front = 0;</p><p> }</p><p> nItems--;</p><p> return temp; </p><p> }</p><p></p><p> public Patient peekFront(){</p><p> return queueArray[front];</p><p> }</p><p> public boolean isEmpty(){</p><p> return (nItems == 0);</p><p> }</p><p> </p><p> public boolean isFull(){</p><p> return (nItems == maxSize);</p><p> }</p><p> </p><p> public int getSize(){</p><p> return this.index;</p><p> }</p><p> </p><p> public Patient get(int index){</p><p> return this.queueArray[index];</p><p> }</p><p> </p><p>}</p><p>[/CODE]</p><p></p><p>[CODE]private void btnAddmissionActionPerformed(java.awt.event.ActionEvent evt) { </p><p> int pID = Integer.parseInt(txtPID.getText());</p><p> String pName = txtPName.getText();</p><p> String pAddress = txtAddress.getText();</p><p> String pSickness = txtSickness.getText();</p><p> String dName = txtDName.getText();</p><p> Patient ptn = new Patient(pID, pName, pAddress, pSickness, dName);</p><p> pQueue.enqueue(ptn);</p><p> tblFill();</p><p> } [/CODE]</p></blockquote><p></p>
[QUOTE="BoraluGoda, post: 13257764, member: 332053"] [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] [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] [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] [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(); } [/CODE] [/QUOTE]
Insert quotes…
Verification
Awruddata maasa keeyada?
Post reply
Top
Bottom