-1

I'm writing a program for a "Ski Area" (I hope that's the English term).

If you know a little bit about skiing, you know there are tracks with different difficulties. Now I want to show all the tracks on my window with a little picture (blue, red, black).

I have an ArrayList where all the information resides. I get the information from a database.

ArrayList<piste> pisteArrayList = dbz.holePistenAusSkigebietNr(skigebietNr);

with a "foreach" I can get the information and make a String:

for (piste p : pisteArrayList) {
    String bezeichnung = p.getBezeichnung();
    int laengeInM = p.getLaengeInM();
    String schwierigkeit = dbz.holeSchwierigkeitAusSchwierigkeitNr(p.getSchwierigkeitNr());

    String text = " " + schwierigkeit + ": " + bezeichnung + " (" + laengeInM + " )" + "\n";

But now here comes the problem: If I use JTextArea I can show the text, but can't show images.

And because I'm a starter I don't know anything else.

Can somebody help?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
  • I wonder if this is best implemented as a custom-painted panel. Do you have an image of what the user might expect to see? BTW I *think* the correct term for 'Ski Area' is 'Ski Runs' or a 'Ski Slope'. But please don't change anything. It should be clear enough as is (with your added words to explain it), and I'm really not *sure* either. – Andrew Thompson Jul 01 '22 at 07:05
  • `for (piste p : pisteArrayList)` As an aside, my native language is English - so Google pushes results that are predominantly *in* English. When I searched 'Ski Area', the term 'Piste' was within the top three results. It's certainly a word I've heard before. We don't mind stealing words from other languages and adopting them as our own. – Andrew Thompson Jul 01 '22 at 07:10

1 Answers1

1

To display images together with text you can use

You have to make up your mind how exactly the output should look.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Queeg
  • 7,748
  • 1
  • 16
  • 42