Ryan Daguman

Ranch Hand
+ Follow
since Feb 20, 2014
Ryan likes ...
Java
I'm Ryan L. Daguman from GMA, Cavite, Philippines. I was born January 15, 1984. I've graduated from college in 2005 at the Eulogio "Amang" Rodriguez Institute of Science and Technology Cavite Campus with a BS degree in Business Education. My first work was at AMDATEX in Las PiƱas city as an encoder in 2005, then in 2006 I started my employment at a call center named ePerformax in Makati city. I worked there for three years and five months. Then in 2009 I was employed at APAC Customer Service Inc., a call center, then in the last quarter of 2010 I was employed at another call center, Teletech where I worked there until 2011. Then I decided to study again to finally make a shift from call centers. I studied a two-year computer programming course at Imus Computer College or ICC from October 2011 to October 2013. As of today, I am unemployed but I'm currently reviewing all the aspects of Java programming by practicing all the exercises in all the books that I have bought. I plan to take the Java Certification examination here in my country as soon as I finish all the exercises in my Java programming books. I hope I can find answers to Java programming problems and errors that I always have trouble in through this site.
GMA, Cavite, Philippines
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
24
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ryan Daguman

I really thank you for your help sir Rob Camick. I learned so many about closing a program with that linked that you provided. Maraming salamat po!
6 years ago
Hi CodeRanch. Again I am faced with another dilemma in Java programming. I have a practice exercise here wherein I will add a JOptionPane to a program. When the close button is clicked, the JOptionPane will appear asking the user to exit the program. If the user clicks "Yes," it'll, of course, close the entire program and not just the JOptionPane, but if the user clicks "No," it will return to the program. Please refer to my code below:



The exercise said it must be placed before the EXIT_ON_CLOSE portion. Please help me. Thank you so much!
6 years ago
Thank you so much Mr. Greg Charles. Yes it did work. I appreciate your inputs. The use AddWindowListener() makes it evident that I'm using an old Java book. It's actually published in 2001, therefore, it's Java 2 SDK and JRE 1.2 during that time. I think I'll buy a new Java book that focuses on, at least, Java 5 or 6 but 7 would be preferable.
6 years ago
Hi I have a program here that doesn't, I hope I use the right term, release resources because after clicking the close button, the DOS prompts becomes unresponsive. So I have to close the DOS prompt, then reopen it, then type in the path again for the Java folders. Can you check where did I go wrong with my code? Is my placement of the WindowListener and WindowAdapter incorrect? Please refer to my code below:



Please help me because I have other programs where the placement of the WindowListener and WindowAdapter are as exactly like this (within the class constructor block) where they close correctly and some that behave like this, that renders the DOS prompt unresponsive. Your inputs will be greatly appreciated. Thank you!
6 years ago
Thank you for inputs. NetBeans did the trick. Today I started using NetBeans and I find it very useful. I am overwhelmed with it because of the convenience it offered. I, therefore, will utilize a code editor when it comes to simple GUI designs and programs without any user interface, but with very complex ones, I'll use NetBeans.
6 years ago
Yes I already tried combining two JPanels into the JFrame but they still looked messy. I mean "looked messy" because the components like the labels, buttons, checkboxes, choice, textfields, and textarea just keep on running through each other. They don't display properly as I expected them to do even though I already set the JFrame into a layout manager. I already tried borderlayout, gridlayout, and also gridbaglayout but it's still no good. As much as possible I'll try to manually code the interface without NetBeans or Eclipse but, I think, with the degree of complexity of the interface, I'll stick to the recommendation by Oracle, use NetBeans. How can I insert an image here in Coderanch using the Img tags from my computer's hard drive so that I can show you a picture of what I want to achieve?
6 years ago
So what is the most appropriately tool to use for designing complicated standalone Java applications?
I am really having a hard time designing the interface of this program. All I need to do is show in just one JFrame the two combined JFrames. One JFrame namely leftPanel will appear to the left or west and the other namely rightPanel to the right or east using BorderLayout. I already did creating them first as JPanels or as internal classes and subsetted them in one JFrame but that didn't work because it looked messy. And now I've created them as two separate JFrames, compiled separately, and tried to subset them as one in the JFrame. I didn't add any functionality to this program because all I intend to do is to show those two JFrames together in one JFrame. Here's the code:


What am I missing or did I code anything wrong here? Or should I use NetBeans IDE for anything as complicated as this? Please help me. Thank you so much.
6 years ago
Oh my goodness I never thought of that. The exercise says "create and store ten different produce codes in an array with local market prices. Once both pieces of data are entered, your program should search for a match in the produce code and multiply it times the weight." So I thought using a loop to traverse all the elements of the array and do a search is the right way of doing it. I never thought of doing result = produceCode[Integer.parseInt(strProduce)] * weight; I thank you so much sir Chris Barrett and I appreciate your help. I thank you as well for your advice that I should never underestimate the System.out.println. Maraming salamat po!
6 years ago


Hi Ryan,

In your updated code, can you explain the logic behind your for loop beginning at line 53? What are you expecting the user to input for the produceCode?
a) Is the user supposed to type in the index value of the element in produceCode? For example, the user enters 1 and the program calculates 5.50 * weight?
b) Is the user supposed to type in the value of 5.50 for the produceCode and your program will determine the index is 1?



Yes you are correct. The user will type in the index value of the element in produceCode. Example, the user enters 1 and then the program calculates 5.50 * weight. I was kind of enervated as midnight approaches here in my country when I created that loop. Sorry, I think the logic of that loop will not help in traversing all the elements of the produceCode array. So, after the user enters the index value of the element in produceCode, searching for a match is next. So how will I code that before I proceed to multiplying the value assigned to that index of the produceCode with weight? Thank you for your help.
6 years ago
Ok to make this simpler, I removed the keypad and the text area and replaced them with two buttons namely Calculate and Erase and three textfields for first: the produce code; second: the weight; and third: for the output. So once I typed in both pieces of information (the produce code and the weight), the program should search for a match in the produce code array and multiply it times the weight. Please refer to the code below:



Please help me with my problem. Thank you.>
6 years ago
Here's the complete code and I hope this helps and relay to your clearly what I'm trying to solve:

>
6 years ago
This is another edit. There are so many indents so I edited it again so that it'll become easy to read.
6 years ago
Repost, I edited it so that it'll be legible.
6 years ago
Like for Choice and ComboBox components, you use the getSelectedIndex() or getItemSelectable() to get the index of what was chosen. So how can I do it with ints, doubles, etc?
6 years ago