EdwinNameless's Profile User Rating: -----

Reputation: 123 Stalwart
Group:
Expert
Active Posts:
720 (0.38 per day)
Joined:
15-October 09
Profile Views:
14,439
Last Active:
User is offline Dec 03 2014 03:51 AM
Currently:
Offline

Previous Fields

Country:
IE
OS Preference:
Linux
Favorite Browser:
FireFox
Favorite Processor:
Who Cares
Favorite Gaming Platform:
Who Cares
Your Car:
Who Cares
Dream Kudos:
300

Latest Visitors

Icon   EdwinNameless is nearly back...

Posts I've Made

  1. In Topic: HELP WITH JAVA CODE

    Posted 28 Nov 2014

    View Postkyle01, on 28 November 2014 - 03:29 PM, said:

    Is this what you mean?

    int chargemins = 0;
    int chargetexts = 0;
    
    


    No: this will cause chargemins and chargetexts to always be 0 which is not correct. It will only be 0 for the conditions I mentioned above; if minutes >= freeMinutes, then you'll have to subtract freeMinutes from minutes just like you were originally doing.

    Does it make sense?
  2. In Topic: HELP WITH JAVA CODE

    Posted 28 Nov 2014

    I mean that if minutes < freeMinutes, then chargemins should probably be 0, and if texts < freeTexts, chargetexts should probably be 0.
    Otherwise chargemins and/or chargetexts will be negative, and then linerental will be wrong.
  3. In Topic: HELP WITH JAVA CODE

    Posted 28 Nov 2014

    My crystal ball tells me you're entering a number of minutes below 75, and/or a number of texts below 275. And then:

    int chargemins = (minutes-freeMinutes); 
    int chargetexts = (texts-freeTexts);
    int costminutes = (chargemins*12);
    int costtexts = (chargetexts*7);
    int linerental = (costminutes+costtexts+1000);
    
    


    Supposedly, if you're are either below 75 mins or below 275 texts, chargemin and chargetexts should be zero – it's only fair, right?
  4. In Topic: Swing UI not responding properly

    Posted 28 Nov 2014

    I am puzzled, though.

    Out of curiosity, what happens if you remove the ButtonGroup (it'll break the radio buttons, obviously, but just to see if this has any impact)?
  5. In Topic: Swing UI not responding properly

    Posted 28 Nov 2014

    It must be some Windows LAF quirk, it displays ok here on a Mac.

    How does this look for you?

    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import java.util.*;
    import java.io.*;
    
    
    class LoginFrame extends JFrame {
    
        LoginFrame() {
            this.setDefaultCloseOperation(EXIT_ON_CLOSE);
            add(new LoginPage());
            setPreferredSize(new Dimension(400, 600));
            pack();
        }
        
        public void run() {
            setVisible(true);
        }
    }
    
    
    public class LoginPage extends JPanel {
        JLabel lblLoginAs;
        JRadioButton rdMentor;
        JRadioButton rdStudent;
        JLabel lblLoginID;
        JTextField txtLogin;
        JLabel lblPassword;
        JTextField txtPassword;
        JButton btnLogin;
        ButtonGroup bg;
        
        public LoginPage() {
            
            lblLoginAs = new JLabel("Login As");
            rdMentor = new JRadioButton("Mentor",true);
            rdStudent = new JRadioButton("Student");
            lblLoginID = new JLabel("Login ID");
            txtLogin = new JTextField();
            lblPassword = new JLabel("Password");
            txtPassword = new JTextField();
            btnLogin = new JButton("Login");
            
            bg = new ButtonGroup();
            bg.add(rdMentor);
            bg.add(rdStudent);
    
            this.setLayout(new GridLayout(10,1));
            this.add(lblLoginAs);
            this.add(rdMentor);
            this.add(rdStudent);
            this.add(lblLoginID);
            this.add(txtLogin);
            this.add(lblPassword);
            this.add(txtPassword);
            this.add(btnLogin);
        }
    
    
        public static void main(String... args) {
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                    @Override
                    public void run() {
                        new LoginFrame().run();
                    }
                });       
        }
    }
    
    

My Information

Member Title:
D.I.C Addict
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Location:
Greystones
Full Name:
Edwin Nameless
Years Programming:
12
Programming Languages:
Java, Python, Ruby, C++, PHP

Contact Information

E-mail:
Private
Website URL:
Website URL  http://

Comments

Page 1 of 1
  1. Photo

    Dogstopper Icon

    10 Nov 2010 - 12:58
    Welcome Back!
  2. Photo

    macosxnerd101 Icon

    06 Nov 2010 - 14:20
    Welcome back, Ediwn!
  3. Photo

    BrainTuner Icon

    31 Mar 2010 - 10:03
    hi,
    nice to meet you mate,
    would you mind take a look at my thread?
    http://www.dreamincode.net/forums/index.php?showtopic=165150&st=0&p=974572&fromsearch=1&#entry974572
    Thanks -)
  4. Photo

    Dogstopper Icon

    17 Mar 2010 - 08:06
    Come back soon!
  5. Photo

    japanir Icon

    11 Feb 2010 - 18:37
    Congrats!! Well deserved!
  6. Photo

    cyril U Icon

    11 Feb 2010 - 05:45
    help me with the .jar file, please .
  7. Photo

    punksryan Icon

    11 Feb 2010 - 05:17
    i'm the second one thanks by the way even there's a small problem at your response... i appreciate it so much
  8. Photo

    Dogstopper Icon

    09 Feb 2010 - 20:24
    First to comment on your profile! Anyway, congratulations on the Expert Edwin! Good job.
Page 1 of 1