Top.Mail.Ru
September 27th, 2006 - Java developers — LiveJournal
? ?

Java developers

September 27th, 2006
Image

01:40 am - Imageemerald_embers

Going to have to apologise without sounding too much like I'm sucking up because I'm only a very basic programmer at the minute so the question is very newbie-ish, but just need to know;

When using System.out.println(), is it possible to print out " marks in any way? Am about to take on a final year project that'll require my programming to be pretty damned good by the end of it, so I've been practising by making a small program to help a friend with formatting html quickly, and in the middle of planning I realised that """" wasn't going to do anything :). So, can someone point me towards a fix for this?
Image

05:16 pm - Imagerottens - math.random problem

hey, I'm fairly new to Java programming, so I was wondering if I could get a little bit of help, or direction.

the following code works fine, but I need to edit it so that the labels are not alphabetic but numeric - so that the labels display 4 digits which are randomly initialized each time. I know I have to use math.random somehow, I'm just not sure how to apply it to my labels and stuff

this is the part of the code that I know I have to change, just not sure how exactly:

import java.awt.*;
import javax.swing.*;

public class AnagramLabels  {
   private Label lab1, lab2, lab3;

   public AnagramLabels(ThreeButtons.ThreeButtonFrame w )  {
      lab1 = new Label();
       lab1.setBounds(230, 30, 200, 40);
       lab1.setFont(new Font("",Font.BOLD,30));
       lab1.setText("ABCD");
       w.add(lab1);
       w.repaint();

       lab2 = new Label();
       lab2.setBounds(230, 70, 200, 40);
       lab2.setFont(new Font("",Font.BOLD,30));
       lab2.setText("EFGH");
       w.add(lab2);
       w.repaint();

       lab3 = new Label();
       lab3.setBounds(230, 110, 200, 40);
       lab3.setFont(new Font("",Font.BOLD,30));
       lab3.setText("TABC");
       w.add(lab3);
       w.repaint();
   }  
   
}
Powered by LiveJournal.com
Image