Win a copy of Practice Tests for OCP Java 17 Certification Exam (1Z0-829) this week in the OCPJP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

Help! I need help w/ALabel(s) to display messages

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,
I have these ALabels(below) - That I need to display an error message and an items list hence the "[]" that I am calling "x-items" after 3 diferent buttons are clicked. I know that I need to create a method to display the x-items and also use my instance variable "count" (int count = 0; ) . I get kinda lost after that. These messages are a result of clicking the 3AbuttonHandler (3 buttons "left" that I am calling "Save", "mid" that I am calling "display", and "right" that I am calling "discard")

(Edited to remove "smiley" -Barry)
private ALabel entries;
private ALabel answer;
private ALabel[] display;
Any advice would be appreciated
Rob
note: I did look for a similar post
[ July 28, 2003: Message edited by: Barry Gaunt ]
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rob, I think you will have to give more context and code for anybody to be able to help you here. What exactly are these "ALabel"s ? The only labels I know are "Labels" from the AWT library or "JLabels" from the Swing Library.
-Barry
 
Rob Michaelson
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Barry
Sorry - yes they are just like JLabels or Labels (text to be displayed in the window).... I am using a custom library(?) from Riley - example: http://www.jinguji.net/course/csc142/alibrary/ALabel.html
Rob
 
Rob Michaelson
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
(I have been able to get to this point)
I am to create a method that displays what has been entered in a textfield("input" below - the "X-items" is a list of ten ie. String [] storage = new String[10];
input = new ATextField(125,400,150,25);
input.place(win);
input.setFontSize(12);
This is what I am having trouble with - how to get the input of (up to) 10 items in JLabel
>>>>HERE IS WHAT I CAME UP WITH>>>
String labelText = "";
for (int i = 0; i < storage.length; i++) {
labelText += storage[i];
}
But it "Can't resolve symbol" in the second line....
Does anyone have any suggestions?
Rob
 
Rob Michaelson
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi folks - an update on my saga - I have in fact got somewhere - at least no syntax errors but it is not working - I need help.
I can�t get anything to display from clicking any of the 3 buttons � one which �saves� the string values and �prints� the number of entries- one that takes those saved values and displays them in the window � and one that discards the items. If I can get the first two I think I could get the last. If anyone is wondering: ALabel is just llike JLabel or Label


Thanks
Rob
reply
    Bookmark Topic Watch Topic
  • New Topic