Strings in JAVA

Asked

Viewed 91 times

1

I once worked with a program where I had a txt file with all Strings values and in the code I just referenced, so everywhere I used the same string I just needed to change in txt and still no problem using accents or special characters (@, #, %, *)

I’m using IDE Eclipse, I don’t know if it changes anything...

An example, when I create a JLabel and I want to define his text I used to:

myLabel.setText("arquivotxt.mystrings.boasvindas");

And the txt file had the line:

arquivotxt.mystrings.boasvindas = "Bem vindos!"

Does anyone have any idea what I’m talking about? 'Cause I need it to make my show better...

  • Didn’t you already ask that question on Saturday? I suggest you visit [Ask] to learn how to ask a question here and read what kind of questions you should avoid asking on the site

  • I asked the question very badly formulated, deleted a few minutes later, because the question was refused too and as I was tired I left to continue my program today...

  • You’re messing with the swing API?

  • I’m using swing yes!

  • So what you’re looking for is handling by properties file, see this answer: Accessing a file using Properties

  • Another answer that will help you: Internationalization in Java

  • Man, that’s exactly what it was, vlw

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.