Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

button and displaying results  RSS feed

 
Meagan Malcolm
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to write a program which allows you to enter a student name, 3 grades, click either alpha or numeric radio button, hit calculate and display results. All these must be in the same window. The problems I am having are 1) how do you display the results of the ButtonListener in another panel, is this possible? and 2) how can results be displayed as either a letter or number in the same field in another panel? I cannot even send any code because I have no idea how to write it. Any help will be appreciated.
 
Vivekkk Singh
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are You Using Swings or SWT. Please be More clear about the Line "display result in the field but in other panel".

Well if you are doing something in Panel1 and want to display result in Panel2(Some Text Field).

Then When you hit the Calculate Button in Panel1.Add a SelectionListener and create a TextField in Panel 2 and set the Text.
Dispose the Panel 2 if some other operation is going.
 
Meagan Malcolm
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using Swing...this is suppose to be a beginner program. I wish I could post what it's suppose to look like but the example won't copy and paste. The farthest we've gotten is beginning arrays, which I haven't even approached this subject within the program for trying to get the program to, at least, display what it's suppose to for the info entered. I'm trying to get a results field in a window with a lot of information, meaning there's no way to get the calculate button in the same panel with the results display. Also, even though a number grade is entered, after choosing a radio button for alpha grade or numeric grade and selecting calculate, it's suppose to display the appropriate type of grade. I cannot figure out how to get the display field to accept either type of grade. I hope I'm not being too confusing, but I am confused myself.
 
Amit Ghorpade
Bartender
Posts: 2856
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Lost Mind " welcome to Javaranch
please check your private messages for an important administrative matter. You can check them by clicking the My Private Messages link above.
 
Vivekkk Singh
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah its very confusing.Well the only thing i figured out from it is:
You have a Text Field for Grade,2 Radio buttons for Type of Grade Numeric and Alpha.
There is Button Calculate,which displays the result either in Numeric format or Alpha Numeric Format(As per the Text Entered in the Text Field).

Have I got it right.




 
Meagan Malcolm
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sorry I'm explaining it so badly...yeah, you've gotten it right. At this point, I believe anything remotely close to what I'm trying to do would help. Thanks for replying.
 
Eric Daly
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you looking for this:
 
Meagan Malcolm
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, my GUI interface has all those fields. I thought I figured out how to calculate the grade but when I run it, I get this bizarre list of errors (compiles okay). Then the instructor threw in accessors, mutators and arrays. Unfortunately, I find myself absolutely lost on how to put all of it together....I am about to give up and take the F.
 
Ravi mca
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i hav a dought, with java include swing concept, can we move a file from one drive to another?
 
Rob Spoor
Sheriff
Posts: 21047
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
File.renameTo can do more than just renaming files.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!