I have a project pls help me.
with java, a basic cinema automation
i must see saloons,films,seances from database and from reservation;can see sales and total tickets.
JAVA CINEMA BOOKING SYSTEMa cinema automation ; ticket reservation and sales about this tickets
Page 1 of 1
4 Replies - 16416 Views - Last Post: 30 April 2010 - 04:42 PM
Replies To: JAVA CINEMA BOOKING SYSTEM
#2
Re: JAVA CINEMA BOOKING SYSTEM
Posted 28 April 2010 - 12:56 PM
Sorry but we can not give you the entire code to solve your problem. We are here to assist in solving problems with code you have written, with any error messages you are getting or what isn't working the way that you expect it to, we would be more than happy to help you with those problems. If there is a topic that you don't understand we would be more than happy to help you with that as well. Make sure to post any code with in code tags like below.
Be sure to visit our tutorial and snippet areas or read the FAQS at the top of the forums. Also, take a moment to read the rules about posting topics.
Thank you for helping us to help you solve your problem.
Be sure to visit our tutorial and snippet areas or read the FAQS at the top of the forums. Also, take a moment to read the rules about posting topics.
Thank you for helping us to help you solve your problem.
#3
Re: JAVA CINEMA BOOKING SYSTEM
Posted 30 April 2010 - 03:25 PM
package javaapplication1;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Seat extends JFrame{
static final Color[] color = {Color.WHITE, Color.RED};
private LifeLabel[][] label;
private boolean mouseDown = false;
public Seat(int x,int y){
super("Seating Plan");
x=2;
y=7;
label = new LifeLabel[x][y];
for(int r = 0; r < x; r++) {
for(int c = 0; c < y; c++) {
label[r][c] = new LifeLabel();
}
}
JPanel panel = new JPanel(new GridLayout(x, y, 1, 1));
panel.setBackground(Color.BLACK);
panel.setBorder(BorderFactory.createLineBorder(Color.BLACK));
for(int r = 1; r < x+1; r++) {
for(int c = 1; c < y+1; c++) {
panel.add(label[r][c]);
}
}
add(panel, BorderLayout.CENTER);
setVisible(true);
}
public synchronized void actionPerformed(ActionEvent e) {
for(int r = 0; r < label.length; r++) {
for(int c = 0; c < label[r].length; c++) {
label[r][c].updateState();
}
}
}
public static void main(String[] arg) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new Seat(100, 100);
}
});
}
class LifeLabel extends JLabel implements MouseListener{
private int state, newState;
LifeLabel(){
state = newState = 0;
setOpaque(true);
setBackground(color[0]);
addMouseListener(this);
}
void updateState() {
if(state != newState) { // do the test to avoid re-setting same color for nothing
state = newState;
setBackground(color[state]);
}
}
@Override
public void mouseClicked(MouseEvent arg0) {
}
public void mouseEntered(MouseEvent arg0) {
if(mouseDown) {
state = newState = 1;
setBackground(color[1]);
}
}
@Override
public void mouseExited(MouseEvent arg0) {
}
public void mousePressed(MouseEvent arg0) {
mouseDown = true;
state = newState = 1;
setBackground(color[1]);
}
public void mouseReleased(MouseEvent arg0) {
// mouseDown = false;
}
}
}
I try to make a seating plan
with a mouse-press,a cell return to another color,pls help me
Admin Edit: Please use code tags when posting your code. Code tags are used like so =>
Thanks,
PsychoCoder
#4
Re: JAVA CINEMA BOOKING SYSTEM
Posted 30 April 2010 - 04:22 PM
Please, 
Also, can you more specifically describing the error(s) or problem(s) you are encountering? "It doesn't work" is a little ambiguous and doesn't help us help you.
Also, can you more specifically describing the error(s) or problem(s) you are encountering? "It doesn't work" is a little ambiguous and doesn't help us help you.
#5
Re: JAVA CINEMA BOOKING SYSTEM
Posted 30 April 2010 - 04:42 PM
Are you receiving any errors? Does this code not work that way you intended it? When asking for help there are a couple items that are vital in order for someone to properly help you:
- Post the code you're having problems with (DONE)
- Post the exact error you're receiving, if you are receiving one
- If no error explain what the code is doing versus what you want it to do
- Post your question in the body of your post, not the description field
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote






|