Hello
The problem is that method actionPerformed does not have access to your button.
You are creating the two buttons inside the LunchPanel constructor.
If you create them in the LunchOrder order class it will work just fine.
public void actionPerformed(ActionEvent e)
{...
Hi
I'm not sure what you mean, maybee the following code
will fix it ?
It will return true or false, depending if the ( and ) are balanced.
public class Check
{
public static boolean BalanceExist(String data)
{
int left = 0;
int right = 0;
for(int i = 0 ; i < data.length() ; i++)...
Well, there is no method in Java to clear the screen(not what I know about)
What you can do is to use the OS commands to do this.
If you are running Linux, *BSD or something else look a like you can try this code, it will work fine.
public void cleerScreen() throws IOException
{...
This one will work
import java.awt.*;
import javax.swing.*;
public class Driver
{
public static void main(String[]arg)
{
JFrame frame = new JFrame();
Container cont = frame.getContentPane();
JPanel panel = new JPanel();
JLabel i = new JLabel(new ImageIcon("mail.gif"))...
I tried that to, didn't work.
You need to set the new JFrame visible and then set focus to the the window.
And what if a computer dosen't run any GUI, then the program will not start after at all...
My last answer was wrong , this is the right one..
Sure, it's easy with GUI to do it.
But I'm not sure that it can be done with java and only console mode.
One suggestion is to use something like
"Press enter to continue..."
Sure, it's easy with GUI to do it.
But I'm not sure that it can be done with java.
One suggestion is to use something like
"Press enter to continue..."
Lets say your file looks like this
a|aa|aaa
b|bb|bbb
c|cc|ccc
then the output will be like
aaaaaa
bbbbbb
cccccc
or was it something else you wanted ?
import java.io.*;
import java.util.*;
public class Driver
{
public static void main(String[] arg) throws IOException
{
StringBuffer...
Hi. I don't remember the getchar funtion, is it enough to just press one button with getchar or do you need to press one button and then press enter ? well here is one exampel where you must press enter too...
import java.io.*;
public class Driver
{
public static void main(String[] arg)...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.