Search:

Type: Posts; User: mwardjava92

Page 1 of 2 1 2

Search: Search took 0.10 seconds.

  1. JColorChooser won't change text color of JLabel

    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...
  2. Re: JMenu disappears when JRadioButtons or JCheckBoxes are used

    But I don't want the menu to close when I click something, I want it to stay open, how would I do this?
  3. Re: JMenu disappears when JRadioButtons or JCheckBoxes are used

    Yes that's it
  4. JMenu disappears when JRadioButtons or JCheckBoxes are used

    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...
  5. Replies
    6
    Views
    2,166

    Re: JComboBox won't add array of numbers

    I took your advice and added 'i', it works now. Thank you.
  6. Replies
    6
    Views
    2,166

    Re: JComboBox won't add array of numbers

    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 ++)
    {...
  7. Replies
    6
    Views
    2,166

    Re: JComboBox won't add array of numbers

    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:
  8. Replies
    6
    Views
    2,166

    JComboBox won't add array of numbers

    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...
  9. Replies
    8
    Views
    1,556

    Re: Menus will not appear in JMenubar

    I played around with the code and I removed 'frame.' from the setJMenuBar() method and it worked. Thanks man
  10. Replies
    8
    Views
    1,556

    Re: Menus will not appear in JMenubar

    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...
  11. Replies
    8
    Views
    1,556

    Re: Menus will not appear in JMenubar

    MenuExample.java:87: non-static variable menuBar cannot be referenced from a static context
    frame.setJMenuBar(menuBar);
    ^
  12. Replies
    8
    Views
    1,556

    Re: Menus will not appear in JMenubar

    I've tried adding 'frame.setJMenuBar(menuBar);' but it gives me an error. Am I on the right track?
  13. Replies
    8
    Views
    1,556

    Menus will not appear in JMenubar

    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...
  14. Replies
    5
    Views
    1,297

    Re: Cannot align JTextField in JPanel

    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?
  15. Replies
    5
    Views
    1,297

    Re: Cannot align JTextField in JPanel

    The symbol above the ^ is the . between 'jtfDetails' and 'setVerticalAlignment'. Yes it is spelt correctly.
  16. Replies
    5
    Views
    1,297

    Cannot align JTextField in JPanel

    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...
  17. Replies
    2
    Views
    1,601

    Re: JScrollPane not showing up

    Thank you! I've been looking at it for hours with no success! :)
  18. Replies
    2
    Views
    1,601

    JScrollPane not showing up

    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.

    ...
  19. Re: GUI won't run properly once panel is added

    I've finally figured it out. What a silly mistake to make! Thanks man.
  20. Re: GUI won't run properly once panel is added

    So one of my JPanels, JButtons or JLabels isn't correct?
  21. GUI won't run properly once panel is added

    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....
  22. Replies
    2
    Views
    3,450

    ArrayList Errors

    // 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 :

    ...
  23. Replies
    4
    Views
    1,773

    Dog Tester Class

    // Tester for Dog class
    // Marcus Ward
    // 11/02/2012

    public class DogTester
    {
    public static void main(String[] args)
    {
    Dog firstDog = new Dog();
  24. Thread: Dog Class

    by mwardjava92
    Replies
    1
    Views
    1,783

    Dog Class

    public class Dog
    {

    private String name = newString(); // instance variables
    private String breed = newString();
    private int heightInInches;

    public void setName(String n) // mutator method...
  25. Replies
    1
    Views
    1,443

    [SOLVED] Display longest string on screen

    // 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...
Results 1 to 25 of 41
Page 1 of 2 1 2