• Post Reply Bookmark Topic Watch Topic
  • New Topic

create a restaurant ordering system  RSS feed

 
llhoyd yap
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anyone can teach me how to create a restaurant ordering system using JFrame thanks....if you have a done code you really help me a lot
plsss help me guys i need it
 
Campbell Ritchie
Marshal
Posts: 56584
172
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

That is not the way we work. We like to see what you have and try to improve it.
 
llhoyd yap
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i see you teach each other...

i post my scource code of my order system here my problem on my code is i want to display on the textarea the buttons that i selected but it didnt work
 
llhoyd yap
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ma'am can you plss help me improve my source code in netbeans
 
Campbell Ritchie
Marshal
Posts: 56584
172
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Show us what you have got.

And don't call me Ma'am.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're talking about the code you posted in the other thread, then you need to update it to include a problem description (as I told you in that topic). I would guess that not many people will be willing to take a hard look at it, because a) it's a mess, as the GUI code created by NetBeans invariably is, and b) there's too much of it (when you add the problem description there, you might also want to cut it down to just that code you're asking about), and c) the incomprehensible variable names make it just about impossible to understand what's going on.
 
llhoyd yap
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wait a second i will just fix the variable names

thanks for your advise
 
llhoyd yap
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {

int total_price= Integer.parseInt((txtfield_tapsi.getText()));
int atap=total_price*50;
if(rbutton_tapsi.isSelected())
{
output.setText("Tapsilog\t"+"50"+"\t"+total_price+"\t"+atap );
}

int totalprice2= Integer.parseInt((txtfield_sisi.getText()));
int asisi=totalprice2*50;
if(jsisi.isSelected())
{
output.setText("Sisilog\t"+"50"+"\t"+totalprice2+"\t"+asisi );
}

in that part of the program is my mistake i can only choose one at a time what i want is i can choose them both.
(output is a name of the textarea)
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "i can only choose one"? "one" of what?
 
llhoyd yap
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
one of the radiobuttons
i want to choose that two radio button and display their output on the textfield
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the exact problem? The code already seems to access two radio buttons, assuming you're talking about rbutton_tapsi and jsisi (in which case the former is confusingly named, because it's not a button).
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The whole point of radio buttons are that you can only select one of them in the group. If you have a set of options and you want to be able to select / unselect them independently, you should use checkboxes instead of radio buttons.
 
llhoyd yap
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what method i will use on the checkbox?
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you discovered the Oracle tutorials?

How to Use Buttons, Check Boxes, and Radio Buttons
 
llhoyd yap
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
im done on the checkbox my problem now is like before i cant choose the two checkbox i can only choose one of them at a time

here is my code
(JCB1 and jCB is the checkbox name)
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
int quantity=Integer.parseInt((txtField1.getText()));
int quantity1=Integer.parseInt((txtField2.getText()));
int atap=quantity*20;
int asisi=quantity1*20;
if(jCB1.isSelected())
{
txtArea.setText("tapsilog\t"+"50"+"\t"+quantity+"\t"+atap+"\n" );
}

else if (JCB2.isSelected())
{
txtArea.setText("\nhotsilog\t"+"50"+"\t"+quantity1+"\t"+asisi);
}
}
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hint: JRadioButtons are meant to be added to a ButtonGroup. JChecBoxes aren't.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!