Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
J

James WG Murphy

@James WG Murphy
About
Posts
5
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Java Conversions
    J James WG Murphy

    I am currently writing a program which will perform binary to decimal, decimal to binary, hexadecimal to decimal, decimal to hexadecimal conversions, 1's compliment, 2's compliment, and show the list of boolean algebra rules. I have created the GUI however, I cannot figure out how to make the Jbuttons generate the coding needed for a binary to decimal conversion of the input in a JTextField. Please help me. The code is below:

    package swing1;

    /**
    *
    * @author James
    */
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.lang.*;
    import java.io.*;

    public class swing {

    public static void main (String\[\] args) {
    
        JFrame frame = new JFrame("Computer Architecture Conversions");
        frame.setVisible(true);
        frame.setSize(500,500);
        frame.setDefaultCloseOperation(JFrame.EXIT\_ON\_CLOSE);
        
        JPanel panel = new JPanel ();
        frame.add(panel);
    
        JButton button = new JButton ("Binary to Decimal") ;
        JButton button2 = new JButton ("Decimal to Binary");
        JButton button3 = new JButton ("Decimal to Hexadecimal");
        JButton button4 = new JButton ("Hexadecimal to Decimal");
        JButton button5 = new JButton ("Library of Boolean Algebra Rules");
        JButton button6 = new JButton ("1's Complement");
        JButton button7 = new JButton ("2's Complement");
        panel.add(button);
        panel.add(button2);
        panel.add(button3);
        panel.add(button4);
        panel.add(button5);
        panel.add(button6);
        panel.add(button7);
        button.addActionListener(new Action());
        button2.addActionListener(new Action2());
        button3.addActionListener(new Action3());
        button4.addActionListener(new Action4());
        button5.addActionListener(new Action5());
        button6.addActionListener(new Action6());
        button7.addActionListener(new Action7());
    }
        static class Action implements ActionListener{
    
            public void actionPerformed (ActionEvent e){
            JFrame frame2 = new JFrame ("Binary to Decimal Conversion");
            frame2.setVisible(true);
            frame2.setSize(500,300);
            JLabel label = new JLabel ("Binary");
            JPanel panel = new JPanel();
            JButton b2d = new JButton("Convert to Decimal Now!");
            JTextField text = new JTextField(25);
            frame2.add(panel);
            panel.add(text);
            panel.add(label);
    
    Java java architecture help tutorial

  • JButton Help
    J James WG Murphy

    I have right clicked on the buttons and added action listeners but I am not sure what coding to enter to establish new jpanels or new jframes. Sun's tutorials do not explain this matter either

    Java java wpf tools architecture help

  • JButton Help
    J James WG Murphy

    I am currently writing a program which will perform binary to decimal, decimal to binary, hexadecimal to decimal, decimal to hexadecimal conversions, 1's compliment, 2's compliment, and show the list of boolean algebra rules. I have created the JFrame and the JButtons to create the GUI however, I cannot figure out how to make each of these Jbuttons open up a new frame or panel. Please help me. I will attach the file and the code is below:

    *
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    */

    /*
    * ConversionGUI.java
    *
    * Created on Mar 16, 2010, 4:50:30 PM
    */

    package c;

    import javax.swing.JFrame;

    /**
    *
    * @author James
    */
    public class ConversionGUI extends javax.swing.JFrame {

    /** Creates new form ConversionGUI */

    public ConversionGUI() {
    initComponents();
    }

    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {

    jButton1 = new javax.swing.JButton();
    jLabel1 = new javax.swing.JLabel();
    jButton2 = new javax.swing.JButton();
    jLabel2 = new javax.swing.JLabel();
    jButton3 = new javax.swing.JButton();
    jLabel3 = new javax.swing.JLabel();
    jButton4 = new javax.swing.JButton();
    jLabel4 = new javax.swing.JLabel();
    jButton5 = new javax.swing.JButton();
    jLabel5 = new javax.swing.JLabel();
    jButton6 = new javax.swing.JButton();
    jLabel6 = new javax.swing.JLabel();
    jButton7 = new javax.swing.JButton();
    jLabel7 = new javax.swing.JLabel();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setTitle("Computer Architecture Converter");

    jButton1.setText("Binary to Decimal");

    jLabel1.setText("B2D");

    jButton2.setText("Decimal to Binary");

    jLabel2.setText("D2B");

    jButton3.setText("Hexadecimal to Decimal");

    jLabel3.setText("H2D");

    jButton4.setText("Decimal to Hexadecimal");

    jLabel4.setText("D2H");

    jButton5.setText("Library of Boolean Algebra Rules");

    jLabel5.setText("LBAR");

    jButton6.setText("1's Complement");

    jLabel6.setText("2C");

    jButton7.setText("2's Compliment");

    jLabel7.setText("1C");

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.c

    Java java wpf tools architecture help

  • Java program help!!!
    J James WG Murphy

    I am currently in a Distributed Systems Implementation class. My group has created a project, which is a food ordering system. It is coded in Java and uses Microsoft Access to make tables for the users, orders, and items. In this class, we are required to connect our program to two servers, one primary and another back-up. Our professor expects the back-up server to be readily available on another computer if the primary server fails on the first computer. Can anyone explain to me how I would link my java coded proram with access to two servers? Thanks

    Java java sysadmin help question

  • Help!!!
    J James WG Murphy

    I am currently in a Distributed Systems Implementation class. My group has created a project, which is a food ordering system. It is coded in Java and uses Microsoft Access to make tables for the users, orders, and items. In this class, we are required to connect our program to two servers, one primary and another back-up. Our professor expects the back-up server to be readily available on another computer if the primary server fails on the first computer. Can anyone explain to me how I would link my java coded proram with access to two servers? Thanks

    Database java sysadmin help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups