mirror of
https://github.com/jokerx3/HeatUp
synced 2026-07-27 08:49:44 +02:00
StatusPanelAdder Layout geändert
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
package de.heatup.ui;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.Font;
|
||||
import java.awt.GridBagConstraints;
|
||||
import java.awt.GridLayout;
|
||||
import java.awt.Insets;
|
||||
|
||||
import javax.swing.JLabel;
|
||||
@@ -34,6 +37,7 @@ public class StatusPanelAdder{
|
||||
}
|
||||
|
||||
public static void setPanel(JPanel newPanel){
|
||||
newPanel.setLayout(new FlowLayout());
|
||||
panel=newPanel;
|
||||
}
|
||||
|
||||
@@ -44,13 +48,26 @@ public class StatusPanelAdder{
|
||||
|
||||
JProgressBar tempBar= new JProgressBar(30,90);
|
||||
tempBar.setValue(45);
|
||||
|
||||
JPanel tempPanel=new JPanel();
|
||||
tempPanel.setLayout(new BorderLayout());
|
||||
tempPanel.add(labelTemp, BorderLayout.NORTH);
|
||||
tempPanel.add(tempBar, BorderLayout.SOUTH);
|
||||
|
||||
|
||||
|
||||
JLabel labelScore= new JLabel("score");
|
||||
labelScore.setFont(new Font("Arial", Font.CENTER_BASELINE, 16));
|
||||
//labelScore.setBorder(new LineBorder(Color.BLACK, 1));
|
||||
|
||||
JLabel scoreLabel= new JLabel("new Score Label");
|
||||
scoreLabel.setBorder(new LineBorder(Color.BLACK, 1));
|
||||
//scoreLabel.setBorder(new LineBorder(Color.BLACK, 1));
|
||||
|
||||
JPanel scorePanel=new JPanel();
|
||||
scorePanel.setLayout(new BorderLayout());
|
||||
scorePanel.add(labelScore, BorderLayout.NORTH);
|
||||
scorePanel.add(scoreLabel, BorderLayout.SOUTH);
|
||||
|
||||
|
||||
JLabel labelPowerUp = new JLabel("PowerUp");
|
||||
labelPowerUp.setFont(new Font("Arial", Font.CENTER_BASELINE, 16));
|
||||
@@ -58,25 +75,43 @@ public class StatusPanelAdder{
|
||||
|
||||
JLabel powerUpLabel = new JLabel(/*new ImageIcon("path_to_image.png")*/"powerUpLabel");
|
||||
//powerUpLabel.setBorder(new LineBorder(Color.BLACK, 1));
|
||||
JPanel powerUpPanel=new JPanel();
|
||||
powerUpPanel.setLayout(new BorderLayout());
|
||||
powerUpPanel.add(labelPowerUp, BorderLayout.NORTH);
|
||||
powerUpPanel.add(powerUpLabel, BorderLayout.SOUTH);
|
||||
|
||||
|
||||
|
||||
|
||||
JLabel labelTime=new JLabel("Time");
|
||||
labelTime.setFont(new Font("Arial", Font.CENTER_BASELINE, 16));
|
||||
//labelTime.setBorder(new LineBorder(Color.BLACK, 1));
|
||||
labelTime.setSize(100,10);
|
||||
labelTime.setHorizontalTextPosition(SwingConstants.CENTER);
|
||||
//labelTime.setHorizontalTextPosition(SwingConstants.CENTER);
|
||||
|
||||
JLabel timeLabel = new JLabel();
|
||||
JLabel timeLabel = new JLabel("123456789");
|
||||
//timeLabel.setBorder(new LineBorder(Color.BLACK, 1));
|
||||
timeLabel.setText("123456789");
|
||||
timeLabel.setFont(new Font("Arial", Font.ITALIC, 12));
|
||||
|
||||
JPanel timePanel=new JPanel();
|
||||
timePanel.setLayout(new BorderLayout());
|
||||
timePanel.add(labelTime, BorderLayout.NORTH);
|
||||
timePanel.add(timeLabel, BorderLayout.SOUTH);
|
||||
|
||||
|
||||
|
||||
|
||||
//Insets(int top, int left, int bottom, int right);
|
||||
|
||||
//panel.add(timeLabel, );
|
||||
|
||||
|
||||
panel.add(timePanel);
|
||||
panel.add(scorePanel);
|
||||
panel.add(tempPanel);
|
||||
panel.add(powerUpPanel);
|
||||
|
||||
|
||||
panel.setVisible(true);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user