This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 21 Developer Study Guide: Exam 1Z0-830 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.

Jo Young

Ranch Hand
+ Follow
since Jun 08, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Jo Young

Paul Clapham wrote:Yeah, that's what all the beginners say.



Seeing as I've been working with Java for all of about 6 months and I have basically taught myself everything I know about Java (with of course obviously some help from the internet/forums/books/etc.)... I do believe I'd say Guilty as Charged

but yeah thank you I will take a look at the link you gave me and see if I can figure out how to use the layout managers properly.
13 years ago

Paul Clapham wrote:XYLayout??? No, no, no, read the tutorial about Using Layout Managers. Laying out your components pixel by pixel looks good to beginners because things seem to work right, but you can only really pull it off if you already know how to use layout managers.

Let me move this post to the Swing forum where the real Swing experts hang out.



I didn't find any other layout that didn't move my components when I created them. I want to actually see what I put down and where I put it not have it just get crumpled up and stuffed in a corner while I'm putting it down and making sure it's right.
13 years ago
nevermind I figured it out it has to have an xylayout in order to put stuff where you want it
13 years ago
... my JPanel keeps moving my components. I put in a JPanel and then tried to put a text field in the JPanel and it wound up being about 3 pixels wide and in the middle of the JPanel.
13 years ago

Paul Clapham wrote:Oh, okay, so "group box" is just an ordinary JPanel then.



Oh so JPanel is what I'm looking for? ok cool thank you
13 years ago

Paul Clapham wrote:The phrase "group box" doesn't ring any bells with me. But if you want a form which can show a variety of panels depending on the context, then a CardLayout does that sort of thing.

I don't see why it's an extra burden to keep track of what should be visible; surely no matter what solution you use, you're going to have to say which panel is currently supposed to be visible?

Anyway here's a link to the tutorial: How to Use CardLayout.




group box is what they are called in C#. And the purpose of a group box is instead of saying for instance:



you can just put 2 group boxes on a form and in one put a 4 labels 3 text boxes and 3 radio buttons and in the other put 3 labels 2 text boxes and 4 radio buttons then have in your code



and do the exact same thing.

group boxes are similar to tabs in that they are (can be) layered but the difference is the user can't see any tab or anything the user can't change which box is showing. As far as the user knows they were all on the same form and you have those 19 lines of code manually showing and hiding each component individually.
13 years ago
Is there a way to do group boxes in Java? So like if I wanted to have one form that can have multiple different things on it and basically depending on the circumstances control whether they see one box or a different one? I know you can do it in C# but the program I am working on now is in Java. I know of course that I could just have all the aspects of it on top of eachother and then change the visibility of each of them individually as necessary I just figured why do all that if I don't have to. Besides that I'm always up to learn a new better way to do something.
13 years ago

Rob Brownsell wrote:
This is document was written back in 2000 (when it comes to Oracle forms, I don't think much has really moved on since then!) but I think the principals are the same

http://www.oracle.com/technetwork/developer-tools/forms/documentation/269054-130573.pdf



Yea from what I've heard Forms hasn't really changed any since like 6i or something like that
13 years ago

Rob Brownsell wrote:I'll try to explain as much as I can in this post but I believe the Oracle website has some information on this. Surely they haven't blocked that site! You need to add frmall.jar to your project, this will give you the forms classes you need (you should find it in your forms installation).



you would think the Oracle website would have stuff on it but I havent been able to find anything as of yet and I have been looking for over a month... there was a few tutorials but they were all program specific and mostly all using netbean and none of them were for JDev 11g and most of it was walking through how that program makes it so you dont have to do much of any coding because the program does your coding for you and almost no actual coding being done which made following it with JDev 11g very difficult if not impossible.

thank you very much I will look through what you gave me and see how I do.
13 years ago
oops sorry for the double post...
13 years ago

Rob Brownsell wrote:Hi there, when calling Java from Oracle forms or adding swing components, I've always used PJCs (pluggable Java components). This has the benefit of using the JVM being used by the client instead of having to use the one that comes with forms. This means you're not tied to the particular version of forms you are running. You have to update your formsweb.cfg to register your jar and put it in the java directory below forms. I know this is a bit different to what you were describing in your post but generally I've found this to be a reliable way to integrate Java into Oracle forms. There's quite a good resource on doing this sort of thing here:

http://forms.pjc.bean.over-blog.com/

One gotcha is if your implementation still uses JInitiator. If this is the case then all your PJCs must use Java 1.3. That's still the case where I work but we should be moving away from it soon (hopefully).



oh ok cool thank you.. unfortunately (stupid internet security makes my job impossible sometimes) I can't get to the link you gave me... thankfully forums are not blocked... however blogs are

I am using JDeveloper 11g Forms 11g and Java 6 (not sure why but for some reason between 1.4 and 5 then decided to drop the "1.")
13 years ago

Rob Brownsell wrote:Hi there, when calling Java from Oracle forms or adding swing components, I've always used PJCs (pluggable Java components). This has the benefit of using the JVM being used by the client instead of having to use the one that comes with forms. This means you're not tied to the particular version of forms you are running. You have to update your formsweb.cfg to register your jar and put it in the java directory below forms. I know this is a bit different to what you were describing in your post but generally I've found this to be a reliable way to integrate Java into Oracle forms. There's quite a good resource on doing this sort of thing here:

http://forms.pjc.bean.over-blog.com/

One gotcha is if your implementation still uses JInitiator. If this is the case then all your PJCs must use Java 1.3. That's still the case where I work but we should be moving away from it soon (hopefully).



oh ok cool thank you.. unfortunately (stupid internet security makes my job impossible sometimes) I can't get to the link you gave me... thankfully forums are not blocked... however blogs are

I am using JDeveloper 11g Forms 11g and Java 6 (not sure why but for some reason between 1.4 and 5 then decided to drop the "1.")
13 years ago
lol yep... now I can do my pushups in peace... woohoo... lol but I think I might start my own company off of this thing!! lol I've now started distributing it out to the rest of the office anyone want their own 30 minute timer??? it has a cool little window with a clock with hours minutes and seconds in military time and says "Do your pushups" every 30 minutes on the 00 and the 30 of the hour!
13 years ago
Rob thank you I actually had tried doing it like that also with the folder and stuff but when I tried to create the jar I created it like

jar cfm PushupTimer.jar Manifest.mf Timer.myTimer.class Timer.timeClock.class

instead of

jar cfm PushupTimer.jar Manifest.mf Timer/myTimer.class Timer/timeClock.class

I just looked back at the tutorial I had used to do this originally and realized that there was a "/" between the folder and the class not a "."

it works now thank you! :-)
13 years ago
yes there is a line at the end of the manifest I had that problem the last time.

the error I get is:

Exception in thread "main" java.lang.NoClassDefFoundError: myTimer (wrong name:
Timer/myTimer)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14
1)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: myTimer. Program will exit.
13 years ago