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) {
...
Type: Posts; User: aStudentofJava
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) {
...
Got this:
java.io.FileNotFoundException: testingfile.txt (The system cannot find the file specified)
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
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...
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...
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...
I found the issue on why it would not instantiate.
public class Lab3 extends JFrame {
/**
* Creates new form Lab3
*/
public Lab3() {
initComponents();
public class ButtonActions implements MouseListener, ActionListener {
public void actionPerformed(ActionEvent event) {
if (event.getSource() == btnSmall) {
...
How would I do that separately?
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...
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.Font;
public class Lab3 extends JFrame {
/**
* Creates new form Lab3
*/
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;
...
I tried this:
public class ButtonActions implements MouseListener, ActionListener {
public void mouseClicked(MouseEvent event) {
String usrInput =...
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.
Hi;
I have this code:
public class Lab3 extends JFrame {
/**
* Creates new form Lab3
*/