Solved

Java GUI to show Boolean Truth Tables

Posted on 2003-11-18
9
832 Views
Last Modified: 2011-10-03
I am a java novice and am trying to prove my worth to my so-called Java 'expert' friends. As a result of this i stupidly took up a bet with one of these friends. The bet was that i would not be able to create a java application that consists of a GUI that will enable a user to enter a Boolean term and the the application will then display a truth table for the that term. To prove that i could do this is told my friend that this would be easy. This was another studip mistake as he then added more stuff to it. The application should also be able to clear any previously entered terms and give the user the option to be able to request that the term be displayed with or without the appropriate brackets. The application should also be able to report an informative error-message if the term that has been entered is not well-formed.

To be total honest i have bitten off more than i can chew here. i do not know where to begin and have no chance off winning this bet. As a result i have know code to show you.

If i can pull it off i will be shown more respect and become more excepted into the circle of 'experts'. No one will help me as they all know about the bet and do not want to get involved.

i know that this question has a background that may be a bit out of the ordinary but any help that can be provided would be greatly appreciated.

Thanks,

garyjohno

ps. i know that this is alot to ask for only 65 points but it is all that i have available. Please help!
0
Comment
Question by:garyjohno
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
9 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 70 total points
ID: 9770146
See previous question asked - it might parse logical expressions too
0
 

Author Comment

by:garyjohno
ID: 9770865
CEHJ your advice was not very good at all.<part of the comment removed from AnnieMod as insult to another member> have u seen how many solved questions there are. there is no way im searchin g through all of those.

can someone else please help me with this.
0
 

Author Comment

by:garyjohno
ID: 9777341

AnnieMod,

I am sorry for using such language. I was frustrated. Sorry and it will not happen in the future.

garyjohno
0
 

Author Comment

by:garyjohno
ID: 9779941
AnnieMod,

yes wel dun. u r on to me cu lata alligator :)

0
 

Author Comment

by:garyjohno
ID: 9780025
only playing with u AnnieMod,

the other question like mine is from a friend of mine. he has taken up the bet 2. the reason he has posted it is because he had more available points than me and he also knows about truth tables, hence the diagram in his question.

i wud not expect an expert to do my homework for me because i have tried that before and was told what you are telling me now. That was before i had read through the EE rules, sorry. I can understand why you are suspicious. This IS a genuine bet and i do need genuine help to win it.

This is the code that i have so far:

import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;

class FirstFrame extends JFrame
{
    FirstFrame()
    {
        super("Truth Table Constructor");
       
        buildGUI();

        setDefaultCloseOperation(EXIT_ON_CLOSE);
        pack();
        setVisible(true);
    }
   
    private void buildGUI() {
        JPanel top = new JPanel();
        top.setLayout(new BorderLayout());
        top.add(new JTextField(25), BorderLayout.CENTER);
        top.add(new JButton("OK"), BorderLayout.EAST);
       
        top.setBorder(new TitledBorder(new EtchedBorder(), "Enter a Statement"));
       
        add(new JButton("Quit"), BorderLayout.SOUTH);
    }
   
    public static void main(String[] args)
    {
        FirstFrame f = new FirstFrame();
    }
}

This code will not execute correctly. Any help will be appreciated

garyjohno
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question