Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Java GUI to show Boolean Truth Tables

Posted on 2003-11-18
9
Medium Priority
?
836 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 140 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

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

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

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

722 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