Metodo Hora

Boas Pessoal, alguem me dá uma dica para por o metodo com um formato de hora (hh:mm), para inserir neste metodo.

public void setRulerValues(
double Min_Arg,
double Max_Arg) {

int  SegmentCount   = Ctrl.getSegmentCount();

if (SegmentCount == 0) {
  SegmentCount = 1;
}

RulerWidth = JComponent1.getSize().height - MARGIN_RULER_LEFT - MARGIN_RULER_RIGHT;
GraduationWidth = (RulerWidth * Ctrl.getSegmentSize()) / (Ctrl.getMaximumValue() - Ctrl.getMinimumValue());

NeverDrawn = false;

int  NewLeftValue   = (int)(MARGIN_RULER_LEFT + ((Min_Arg - Ctrl.getMinimumValue()) * RulerWidth) / (Ctrl.getMaximumValue() - Ctrl.getMinimumValue()));
int  NewRightValue  = (int)(MARGIN_RULER_LEFT + ((Max_Arg - Ctrl.getMinimumValue()) * RulerWidth) / (Ctrl.getMaximumValue() - Ctrl.getMinimumValue()));

if (NewLeftValue <= NewRightValue && NewLeftValue >= MARGIN_RULER_LEFT && NewRightValue <= MARGIN_RULER_LEFT + RulerWidth) {
  LeftValue  = NewLeftValue;
  RightValue = NewRightValue;

  int TriangleSide = RulerHeight / 2;
  TriangleSide = Math.max(Math.min(TriangleSide, 20), 10);

if (UIManager.getLookAndFeel().getName().equals("Metal")) {
  int[] xp1 = {LeftValue,  LeftValue-7, LeftValue-7, LeftValue-6, LeftValue+6, LeftValue+7, LeftValue+7};
  int[] yp1 = {Margin_Ruler_Top + RulerHeight + 1-14,
               Margin_Ruler_Top + RulerHeight + 1-7, Margin_Ruler_Top + RulerHeight +1, Margin_Ruler_Top + RulerHeight + 1+1,
               Margin_Ruler_Top + RulerHeight + 1+1, Margin_Ruler_Top + RulerHeight +1, Margin_Ruler_Top + RulerHeight + 1-7};
  TheLeft_Polygon = new Polygon(xp1, yp1, 7);

  int[] xp2 = {RightValue-7, RightValue-7, RightValue-6, RightValue+6, RightValue+7, RightValue+7, RightValue}; 
  int[] yp2 = {Margin_Ruler_Top - 1+7, Margin_Ruler_Top - 1, Margin_Ruler_Top - 1-1, 
               Margin_Ruler_Top - 1-1, Margin_Ruler_Top - 1, Margin_Ruler_Top - 1+7,
               Margin_Ruler_Top - 1+14,};
  TheRight_Polygon = new Polygon(xp2, yp2, 7);

} else { // Triangles by default
  TheLeft_Polygon = new Polygon();
  TheLeft_Polygon.addPoint(LeftValue ,                Margin_Ruler_Top + RulerHeight - RulerHeight/2 - 1);
  TheLeft_Polygon.addPoint(LeftValue + RulerHeight/2 + 2, Margin_Ruler_Top + RulerHeight + 1);
  TheLeft_Polygon.addPoint(LeftValue ,                Margin_Ruler_Top + RulerHeight + 1);
  TheLeft_Polygon.addPoint(LeftValue ,                Margin_Ruler_Top + RulerHeight - RulerHeight/2 - 1);

  TheRight_Polygon = new Polygon();
  TheRight_Polygon.addPoint(RightValue - 2 - RulerHeight/2, Margin_Ruler_Top - 1);
  TheRight_Polygon.addPoint(RightValue , Margin_Ruler_Top - 1);
  TheRight_Polygon.addPoint(RightValue , Margin_Ruler_Top + RulerHeight/2 + 1);
  TheRight_Polygon.addPoint(RightValue - 2 - RulerHeight/2, Margin_Ruler_Top - 1);      
} 
} else if (Ctrl.getSize().width == 0 || Ctrl.getSize().height == 0) {

} else {
  System.err.println("\nsetRulerValues()");
  System.err.println("  Size              = " + Ctrl.getSize());
  System.err.println("  NewLeftValue      = " + NewLeftValue);
  System.err.println("  NewRightValue     = " + NewRightValue);
  System.err.println("  MARGIN_RULER_LEFT = " + MARGIN_RULER_LEFT);
  System.err.println("  MARGIN_RULER_LEFT + RulerWidth = " + (MARGIN_RULER_LEFT + RulerWidth));
  //Debug.debug(0, "");
}

} // setRulerValues()

Cara, está difícil de entender o que está querendo!
Que código é esse?
O que está tentando fazer?
Especifica melhor aí!

Veja se isto lhe ajuda:

SimpleDateFormat df = new SimpleDateFormat("hh:mm");
Date data = new Date();
System.out.println(df.format(data));

Abraço.

Boas Linkel, é o seguinte eu tenho esta barra http://bislider.dev.java.net/ é exactamente o k kero.Mas preciso de lhe alterar o formato de valor,ou seja ela está das 0 a 100, e eu quero por isto com o formato de hora hh:mm, ou seja das 00:00 as 24:00.Como fazer isto ???

Cumprimentos

Boas pessoal, eu preciso exactamente disto

SimpleDateFormat format = new SimpleDateFormat(“dd/MM/yyyy hh:mm:ss”);
try {
Date d = format.parse(“10/10/2007 08:10:23”);

       SimpleDateFormat format2 = new SimpleDateFormat("hh:mm");   
       String formatada = format2.format(d);   
          
       System.out.println(formatada);   
    } catch (ParseException e) {   
       e.printStackTrace();   
    } 

de transformar uma string que tem data e hora, e eu so preciso de mostrar a hora.Esse código que colocou ai é perfeito.mas eu preciso de adaptar isso a uma range slider bar com este código.como faço isso???

if (MinimumValueString!=null)
try {
BiSliderWeb.setMinimumValue(Integer.parseInt(MinimumValueString));
} catch (NumberFormatException NumberFormatException_Arg) {
NumberFormatException_Arg.printStackTrace();
}
else
BiSliderWeb.setMinimumValue(0);

if (MaximumValueString!=null)
try {
BiSliderWeb.setMaximumValue(Integer.parseInt(MaximumValueString));
} catch (NumberFormatException ex) {
ex.printStackTrace();
}
else
BiSliderWeb.setMaximumValue(100);

preciso que em vez de 0 a 100, seja de 00:00 a 24:00…alguem me pode ajudar??

Cumprimentos