I'm trying to create a JColorChooser dialog box with a JLabel above it, so that the JLabel text color will change to the color chosen with JColorChooser by the user. Here's what I have so far, but it...
Type: Posts; User: mwardjava92
I'm trying to create a JColorChooser dialog box with a JLabel above it, so that the JLabel text color will change to the color chosen with JColorChooser by the user. Here's what I have so far, but it...
But I don't want the menu to close when I click something, I want it to stay open, how would I do this?
I have created a JMenuBar with a Pizza JMenu. The JMenu has a 3 JRadioButtons and 2 JCheckBoxes that are appear when menuItems are scrolled over. The problem is that when I click on a JRadioButton or...
I took your advice and added 'i', it works now. Thank you.
I have added:
jcbSizes = new JComboBox();
This has taken care of the error in main I was getting.
I have also changed the for loop to:
for(int i = 1; i < 100; i ++)
{...
I have found and added the addItem() method to get this:
for(int i = 1; i < 100; i ++)
{
jcbFonts.addItem(sizes);
}
It is compiling but I am getting this error when I run it:
I'm creating a JFrame that allows the user to change the font and font size of a piece of text by using 2 JCheckBoxes. The first JCheckBox gives the user every font available and it works fine. The...
I played around with the code and I removed 'frame.' from the setJMenuBar() method and it worked. Thanks man
Yes line 87 was in the main() method. I moved the code to the constructor, but now I am getting this error:
MenuExample.java:76: cannot find symbol
symbol : variable frame
location: class...
MenuExample.java:87: non-static variable menuBar cannot be referenced from a static context
frame.setJMenuBar(menuBar);
^
I've tried adding 'frame.setJMenuBar(menuBar);' but it gives me an error. Am I on the right track?
I have created 2 JMenus with various JButtons, JCheckboxes and a submenu. They are compiling and running ok. The problem is that they filling the full length of the JFrame, instead of appearing as...
It's defined in the JLabel class. setVerticalAlignment isn't defined in the JTextField class, so does that mean I must use a different method?
The symbol above the ^ is the . between 'jtfDetails' and 'setVerticalAlignment'. Yes it is spelt correctly.
I'm writing a GUI for a DVD player. I'm attempting to align the JTextField to the center of the JPanel, but I am getting this error:
DVDPlayer.java:23: cannot find symbol
symbol : method...
Thank you! I've been looking at it for hours with no success! :)
I'm trying to write a GUI that has 2 JPanels, the left panel with an image and JLabel below it, and the right one with a scrollable JTextArea. For whatever reason the JTextArea isn't showing up.
...
I've finally figured it out. What a silly mistake to make! Thanks man.
So one of my JPanels, JButtons or JLabels isn't correct?
Hi,
This GUI will compile but does not run. I know it is something to do with panel 'p2' as when I remove it, it runs fine.
I have posted the error below. Help would be greatly appreciated....
// I was asked to create an arraylist of strings, print out each element in
// the arraylist, the longest string and it's location. Below are the errors I am getting and the code.
Errors :
...
// Tester for Dog class
// Marcus Ward
// 11/02/2012
public class DogTester
{
public static void main(String[] args)
{
Dog firstDog = new Dog();
public class Dog
{
private String name = newString(); // instance variables
private String breed = newString();
private int heightInInches;
public void setName(String n) // mutator method...
// Practical 1B - Question 2
// Marcus Ward
// 27/01/2012
// Program asking user for two strings, and then it will display the longest string on screen.
import java.util.Scanner;
public...