Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Are you sure that you have re-compiled the source with these latest changes?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

The "Go to new post"(on the purple New button) and "Go to last post" (right side Last Post) links in the forum listings seem to be broken at the moment. They result in an invalid page.

Edit: I also got an invalid page when I submitted this new thread.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I am running the code right now and when I click the paste button, the text from the textfield is centered in the label below it.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Edit: oops cross-posted, I guess you found the same thing :)
Try this

public void init() {
		one = new JButton("one");
		two = new JButton("two");
		three = new JButton("three");

		setLayout(new BoxLayout(getContentPane(), BoxLayout.PAGE_AXIS));
		add(new JLabel("This is the contentPane."));
		JPanel twoPanel = new JPanel();
                twoPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
		twoPanel.setLayout(new BoxLayout(twoPanel, BoxLayout.LINE_AXIS));
		twoPanel.add(new JLabel("Second Panel"));
		twoPanel.add(new JTextField("Text Field"));
		add(twoPanel); // comment this line out

                one.setAlignmentX(Component.LEFT_ALIGNMENT);
                two.setAlignmentX(Component.LEFT_ALIGNMENT);
                three.setAlignmentX(Component.LEFT_ALIGNMENT);
		add(one);
		add(two);
		add(three);
	}
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Try

twoPanel.setLayout(new BoxLayout(twoPanel, BoxLayout.PAGE_AXIS));

edit: Hmm, scratch that, it doesn't preserve the horizontal ordering that you wanted for the second panel.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Nope, doesn't work - and as a general rule we don't just hand students completed solutions to their homework problems.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I don't understand the question. That label is already centered when I run your code.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

The errors are pretty clear. You can't use the variables firstName and lastName in main() if you haven't declared them.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

In the first case you posted, either "c" or "stmt" is probably null

c.stmt.executeQuery(str);

In the second part, you only have two parameters specified in the query, so you can't set number 12

c.stmt.setInt(12,cnt);
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

> He might have fault too but he might be too careless to realise that
Sure, maybe he mistakenly checked the "Cut off my balls" box because it was directly below "Remove gallstones" and the form was single-spaced.
:-/

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

How do you expect to accomplish this if you have no understanding of coding?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Just use !myString.matches(...) instead.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You should be able to use the same basic structure as you did with the open(0 method, but use ImageIO.write() to write the image out to file. Similar to this

if (chooser.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) {
    File fileChoosen = chooser.getSelectedFile();
    try {
        ImageIO.write(img,"bmp",fileChoosen);
        ...

You may want to also take a look at the tutorial on saving an image:http://download.oracle.com/javase/tutorial/2d/images/saveimage.html

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Post code, ask specific questions about APIs or the environment you're working with, etc.

Your question as written is about as generic as "Help me make my computer do stuff".

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

No, because this question is so non-specific as to be unanswerable.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You could use (Mr|Mrs|Miss){1} , but really equalsIgnoreCase() could be used just as well for those three specific cases.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Simply add "newPerson" to your ArrayList.

List<Person> people = new ArrayList<Person>();
people.add(newPerson);

You can retrieve them with get()

people.get(0);  // returns first person in list
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You can only have a single layout per container, but you don't need to change your JPanel layout. I am referring to the JFrame layout.

public void setupLayout(Container pane) {
        setLayout(new BorderLayout());
...
        add(titlePanel, BorderLayout.NORTH);
...
        add(mainScroller, BorderLayout.CENTER);
...
    }
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

It's because you used the default layout in the frame, which is FlowLayout. Try BorderLayout and put the the title panel in NORTH and the mainPanel in CENTER.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

@Unhnd_Exception: I believe they may actually be Northing and Easting UTM values.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Sorry, accidentally down-checked this post - unfortunately, once you do that I don't know of a way to undo it... my bad!

Yeah, unfortunately there is no way to cancel it even on an accidental click. I voted it back up to offset :)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

The stack trace tells you exactly which line the exception occurs on. Read it and figure out why the variable you are calling a method on is null.

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

Metal/metalcore/(other sub-genres, blah blah blah)

Newer: As I Lay Dying, Lamb Of God, Killswitch Engage, Parkway Drive, Disarmonia Mundi, In Flames

Older classics: Megadeth, Metallica, Anthrax, Testament, Slayer, Iron Maiden, Queensryche

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

@ Ezzaral

I agreed with that, it will be very good JOKE how to set null for JFormattedTextField with Number Instance (f.e.), and so on ...

<FW>Both setText(null) and setText("") then you just can test with

if(!"".equals(someString))

</FW>

I think that isn't good advice for OP, nothing else, I escaped form this FW about empty/null

He isn't using JFormattedTextField, so I would say you are just nitpicking for no good reason. The two are equivalent for the purposes of his question.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

> where do I change the layout?
Did you read the tutorial that I posted the link to?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

@mKorbel: Both setText(null) and setText("") will have the same result on the component. getText() will return an empty string in both cases.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

> is there a way to clear a JTextField after a button is pressed?
setText(null)

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

'Home' key is your friend.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Disarmonia Mundi - Quicksand Symmetry

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

Show some effort. Ask specific questions. Do not simply post an assignment and expect a solution.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Closing. Too many lazy people begging for a solution to be handed to them.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I'm wondering why you bother using the with clause here and then repeat your variable?

With Adodc5.Recordset
    Adodc5.Recordset.AddNew
    Adodc5.Recordset.Fields("Name") = txtsibling1.Text
    Adodc5.Recordset.Fields("Age") = txtage1.Text
    Adodc5.Recordset.Fields("Birthdate") = Format(txtbirth1.Text, "mm/dd/yyyy")
    Adodc5.Recordset.Update
    Adodc5.Refresh
End With

It defeats the entire point of the with statement

With Adodc5.Recordset
    .AddNew
    .Fields("Name") = txtsibling1.Text
    .Fields("Age") = txtage1.Text
    .Fields("Birthdate") = Format(txtbirth1.Text, "mm/dd/yyyy")
    .Update
    .Refresh
End With
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Ask a specific question. Post the code that you have started with.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Git, Mercurial and Subversion are all popular. It looks like most of them have plug-ins to work with Visual Studio.

We're using Subversion here and I like it well enough, but we work in Java so I can't speak to it's usage within VS.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Unless Class1 and Class2 are nothing more than simple data structures, the convention is to write getters that return those values rather than declaring them public. i.e. class1thing.getValue()

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

The Oracle docs seem to be working just fine at the moment (your mileage may vary).

Take a look at Storage and Resource for your file system questions.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Lamb of God - Redneck

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Nice to see people even welcome the members who have already gotten themselves banned ;)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

It's trying to run the class Main in the package firstgui. I'd look into why it's looking for Main.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

FirstGUI is not the same as firstgui .

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Wamp Server is another all-in-one install option.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Looks to be 9+ errors - not 1.

Read the first. You're trying to evaluate a method that has no return ("void") as a boolean in an if() statement. Did you perhaps mean to see if getStars()==5 ?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

The stack trace tells you exactly what the error is. Read it and post it.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Are you going to share the error or is this a guessing game?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

And I will be happy to tell him if he does ask.

Complaining about moderation is not adding anything to this thread from 2009.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

> I need a php code ...
Start writing then. When you have problems, post the code and specific questions.

This is not a homework completion service.

diafol commented: well said +8
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Swapping out a single button in the layout would not pose a performance problem, but I agree that rebuilding the whole thing is unnecessary and undesirable.

Since little info was given about the other responsibilities of ScrabbleButton and the rest of the program, it's hard to make good suggestions on how things might be better organized. It seems the button just needs to change it's text and there is no reason to remove it from the GUI at all.