Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

If you don't want to allow them to even type anything but numbers into field, you need to use the MaskFormatter: http://java.sun.com/docs/books/tutorial/uiswing/components/formattedtextfield.html#maskformatter
(Which you will see is covered in the first link I posted above on using JFormattedTextField)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Those things are covered by the tutorials that I linked above.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Changing that code to use getClass().getResource() works perfectly on my machine. Attaching the revised jar (I had to put it in a zip file since it won't allow me to attach a .jar)

TheWhite commented: tank you! +1
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Where can we find practice exams for the stupid test?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You gave a link to the JDK 1.5 api doc index, copied a description of an AbstractCollection, and asked a nearly incomprehensible question. What am I trying to keep up with exactly?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Thanks for posting generic information on a Collection for whoever might randomly need such, but it doesn't change the fact that the actually return type of that collection can only be ascertained by the api itself. Perhaps you need to reword your original question, because based upon this last post above it's not very clear what you are wanting to know.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Actually I didn't take the test - I couldn't get the little clicky-thing to work the internets right.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

That is just a stupid thing to say. Certainly there are diploma mills out there, but I don't think there is anything wrong with an online degree as long is it comes from an accredited college.

And you'll note that I did not state unequivocally all online degrees are useless. But the fact that you "don't think there is anything wrong" with an online degree is obviously grounded in well-researched reality and therefore proves it to be "stupid".

Though perceptions are slowly changing, are you really denying that many people, including employers, do not view an online degree in a lesser light than a brick-and-mortar institution degree? While my comment was made somewhat tongue-in-cheek, it's not exactly an uncommon perception that online degrees are somewhat suspect in their value.

I'm sure that will disappear overnight though, now that you have decided you think it's stupid.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

There is absolutely no way to tell the type of the collection from that line of code. The return type of that method will be documented by whatever API describes the class of "searchQuery1".

The question about "search" vs "Search" doesn't make any sense - it's your variable declaration, call it whatever you want.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

If you take seriously the results of such a test on the internet, then yes - you're stupid.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Look around you a bit - you might not be where you think you are...

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Set your property values before you write it to the file. Setting values on the Properites object after you wrote it isn't going to update the file for you.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

There is a wealth of info on the Sun certifications and exams online that you could easily locate with a simple search, but there is no Certified Java Administrator (what is there to "administer" in Java?). SCJA is Sun Certified Java Associate and you can get more info here: http://www.sun.com/training/certification/java/index.xml and by searching a bit on your own.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Not sure what to tell you then, because that exact jar structure and loading code works just fine for me.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Those are the things you have to consider when choosing which layouts to use. Each has it's own purpose and constraints. What you are describing above would be easily tamed with a GridBagLayout, which is highly flexible but trickier to get used to. Here's an example

JLabel lblDay = new JLabel("Day");
        JLabel lblWeek = new JLabel("Week");
        JLabel lblMonth = new JLabel("Month");

        Dimension comboDimension = new Dimension(120, 18);
        JComboBox cboDay = new JComboBox();
        cboDay.setPreferredSize(comboDimension);
        JComboBox cboWeek = new JComboBox();
        cboWeek.setPreferredSize(comboDimension);
        JComboBox cboMonth = new JComboBox();
        cboMonth.setPreferredSize(comboDimension);

        JButton leftButton = new JButton("<<");
        JButton rightButton = new JButton(">>");

        JPanel topButtonPanel = new JPanel();
        topButtonPanel.setLayout(new GridBagLayout());
        GridBagConstraints constraints = new GridBagConstraints();
        constraints.gridx = 0;
        constraints.anchor = GridBagConstraints.EAST;
        constraints.insets = new Insets(2, 4, 2, 4);
        topButtonPanel.add(lblDay, constraints);
        topButtonPanel.add(lblWeek, constraints);
        topButtonPanel.add(lblMonth, constraints);

        constraints.gridx = 1;
        constraints.anchor = GridBagConstraints.WEST;
        constraints.insets = new Insets(2, 4, 2, 4);
        topButtonPanel.add(cboDay, constraints);
        topButtonPanel.add(cboWeek, constraints);
        topButtonPanel.add(cboMonth, constraints);

        JPanel bottomButtonPanel = new JPanel();
        bottomButtonPanel.add(leftButton);
        bottomButtonPanel.add(rightButton);

        JPanel buttonPanel = new JPanel();
        buttonPanel.setLayout(new BorderLayout());
        buttonPanel.add(topButtonPanel, BorderLayout.NORTH);
        buttonPanel.add(bottomButtonPanel, BorderLayout.SOUTH);

        JFrame frame = new JFrame();

        frame.add(buttonPanel);

        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(FRAME_WIDTH, FRAME_HEIGHT);
        frame.setVisible(true);
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You can setPreferredSize() and some layout managers will honor it, but it's not guaranteed. It depends on the layout manager how component sizing is handled. You would need to be more specific about the placement and sizing behavior you are wanting to give a more direct answer.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I would try to verify that the images package(directory) is actually in the jar file. Depending upon how you created the jar, those files may have gone into the root of the jar, in which case "images/flag2.gif" would not resolve correctly.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Some might say they are worth just as much as most online degrees.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Have you read the Programming FAQ at the top of the forum?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Then post the code here in [code] [/code] tags and the exact error messages.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

According to this listing: http://java.sun.com/products/java-media/jmf/2.1.1/formats.html AVI is supported.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Interfaces can only contain method signatures and final static fields. They are not the same as a class. You need to write a class that implements the interface if you want to add other properties.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

DO yu have the code for the other classes......I have to write the whole code for all classes...So if you could can you please send me the rest of the code
Thanks Chamsups
PS; My email is chamsups@yahoo.com

This is not a "gimme teh codez" forum. Do your own work and post specific questions if you are having problems. I hope you realize how incredibly lame your request is.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Ah.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Try moving your images directory into your source('src') directory and see if that rectifies the build and resource location problem.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Read the error message closely, they are pretty clear about the issues. You are calling things that do not exist in the parent class in that first file. The second file has structural problems such as a missing brace or semi-colon.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

As I don't use Eclipse, I couldn't tell you exactly how to get that folder onto your build path correctly, but the getResource() method attempts to locate a resource based on your classpath. This means that the path you specify must be relative to one of those entries. If your images in the jar file are within a directory called "images", then the code you are using above should locate them just fine.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Opening a new cmd window should be all that is required to pick up the change.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Use getResource() to load the images instead of the simple path

ImageIcon qmarkIcon = new ImageIcon(getClass().getResource("images/mark.gif"));

More info on this here if you want to understand the nuances: http://java.sun.com/docs/books/tutorial/uiswing/components/icon.html#getresource

majestic0110 commented: Know it all lol! Great help! +2
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Reflection allows you to use classes dynamically at runtime in ways that were not specified at compile time by providing methods to query and work with the class internals. The Sun trail on Reflection describes this better than I can here:
http://java.sun.com/docs/books/tutorial/reflect/index.html

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Correct. An object is an instance in memory of a class. It has no context at compile time because nothing is running. An object by definition is a runtime entity.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

JLabel is handy for displaying such images if you are wanting them to be separate from your buttons.
http://java.sun.com/docs/books/tutorial/uiswing/components/label.html

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

So my suspicion is correct? That.....

No. The point was that all objects are runtime constructs. Classes are created at compile time. This has nothing to do with reflection.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Can anybody help me out? I have a list of e-library websites in which I need to develop an e-Library Search Engine, so that any student can just use the search engine to search of information and the results will be displayed on the search engine page like Google. So in a nutshell, a Search Engine that can search within a number of Websites unlike Google that has unlimited number of websites to search through

I'm not sure searching is really your strong suit. Perhaps another project would be in order :P

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Your question is too broad. Which part of the desired operation do you not understand? Do you know how to save data to a database? Do you know how to retrieve values from a UI component? You need to narrow your question a bit, unless you expect someone to write a demo of this entire operation for you, which I would assume is highly unlikely to be done.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Read the stack trace. It's clear from this

Caused by: Exception [TOPLINK-8025] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): 

oracle.toplink.essentials.exceptions.EJBQLException 
[B]Exception Description: Syntax error parsing the query [:partial], line 1, column 1: unexpected token[/B] [:partial]. 
Internal Exception: line 1:1: unexpected token: :partial

that you have a syntax error in your query.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

A directory is deleted just like any file - with File.delete(). A directory must be empty to be deleted, so if it contains files you must recurse the directory and delete all files and subdirectories first.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

There are a ton of basic tutorials for this. The Swing trail from Sun is a great place to start:
http://java.sun.com/docs/books/tutorial/uiswing/components/frame.html

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You don't delete objects - they get cleaned up when they go out of scope and have no more active references.

Perhaps this article will answer your questions: http://www.ibm.com/developerworks/java/library/j-jtp01274.html

(though next time, you don't need to put 15 questions marks on them - one will suffice)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

After you added your mouse listener, the mouseListeners collection contained 2 listeners: The original BasicButtonListener, and the one that you added. That code b.removeMouseListener(b.getMouseListeners()[0]); removed the BasicButtonListener because it was at index 0, leaving yours still in place.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Use a JDialog that is modal. It's hard to be more specific since there are a few different ways in which JOptionPane and JDialog can be used.
http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

This is done by default if you specify the "parent" parameter. If you are using your own JOptionPane class you can use setLocationRelativeTo().

http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Your button already has a mouse listener installed before you add your own. The button starts with a BasicButtonListener by default. Your action listener is removing that listener, but leaving your own mouse listener in place.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

It's faster than viewing the profile. ;)

Yeah, but I usually end up reading other comments they got rep on anyway so I suppose it's a wash :twisted:
It was just one of those "throw it out there" suggestions. I won't be offended if it's dismissed to avoid a riot by those crazy tool-tip haters :P

(Edit: Not to mention that it might be too technically awkward in the current framework to even be worthwhile considering anyway.)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

OMG.. I stated my intake on the subject..2012, the End of the World? And.. lmao.. everyone got their panties in a wod.. Pick me apart like buzzards. I don't care.. lol

You give yourself too much credit.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You can click on the add to reputation button and it displays all the comments.

Yeah, but I don't really want to add rep - just see it - and then you have to click somewhere else to make the rep box go away without adding to rep. A hover tooltip just seemed like it would be a convenience. Certainly not something that I would put into a "pisses me off" category though.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I've wondered for awhile now if it would be possible to display the Reputation comments in a mouseover tooltip on the little dot? Currently you have to leave the thread and go view that person's profile to see what the reason for the rep was.