Search:

Type: Posts; User: aStudentofJava

Search: Search took 0.65 seconds.

  1. Re: When a button is clicked: get my Data!!!

    if it is inside a package how would I get the relative path name?

    or would the getAbsolutePath() do the trick :)

    i tried this:



    public void actionPerformed(ActionEvent e) {
    ...
  2. Re: When a button is clicked: get my Data!!!

    Got this:

    java.io.FileNotFoundException: testingfile.txt (The system cannot find the file specified)
  3. When a button is clicked: get my Data!!!

    Hey There..

    I'm having a problem occurring within my code.

    I have a txt file containing jibberish called testingfile.txt


    testingfile.txt contains:

    hithere34|where 293|21|3|9
  4. [SOLVED ] Getting the Selected Value in JComboBox

    So I'm looking for a way to check if the certain value of a JComboBox is selected.

    I've tried event.getSource() == comboBox.getSelectedItem()

    But it's not going to work since I don't specify...
  5. Replies
    23
    Views
    1,290

    Re: Compress my Code!

    With the two listeners on the button and I added printlns to each Listener. It does print out.

    Foolish of myself, the default size output without a Radio Button being pressed is 12, and the font...
  6. Replies
    23
    Views
    1,290

    Re: Compress my Code!

    I was just testing to see if it would make a difference.
    Is there a way for my 'above post' possible?

    "But I'm wondering how am I going to make it when I mouseClick, it will use the...
  7. Replies
    23
    Views
    1,290

    Re: Compress my Code!

    I found the issue on why it would not instantiate.


    public class Lab3 extends JFrame {

    /**
    * Creates new form Lab3
    */
    public Lab3() {
    initComponents();
  8. Replies
    23
    Views
    1,290

    Re: Compress my Code!

    public class ButtonActions implements MouseListener, ActionListener {

    public void actionPerformed(ActionEvent event) {
    if (event.getSource() == btnSmall) {

    ...
  9. Replies
    23
    Views
    1,290

    Re: Compress my Code!

    How would I do that separately?
  10. Replies
    23
    Views
    1,290

    Re: Compress my Code!

    Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
    at prog24178.Lab3.<init>(Lab3.java:24)
    at prog24178.Lab3$1.run(Lab3.java:382)
    at...
  11. Replies
    23
    Views
    1,290

    Re: Compress my Code!

    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.Font;

    public class Lab3 extends JFrame {

    /**
    * Creates new form Lab3
    */
  12. Replies
    23
    Views
    1,290

    Re: Compress my Code!

    These are the list of variables that I am using:


    private javax.swing.JCheckBox btnBold;
    private javax.swing.JRadioButton btnCentre;
    private javax.swing.JCheckBox btnItalic;
    ...
  13. Replies
    23
    Views
    1,290

    Re: Compress my Code!

    I tried this:



    public class ButtonActions implements MouseListener, ActionListener {

    public void mouseClicked(MouseEvent event) {
    String usrInput =...
  14. Replies
    23
    Views
    1,290

    Re: Compress my Code!

    The last posted code was just a pseudo I came up with.
    I tried doing what I typed in there but I get an error when I tried to event.getSource()==btnSmall.
    It says it cannot recognize it.
  15. Replies
    23
    Views
    1,290

    [SOLVED] Compress my Code!

    Hi;

    I have this code:


    public class Lab3 extends JFrame {

    /**
    * Creates new form Lab3
    */
Results 1 to 15 of 15