private void startGame() { time = 0; counter.start(); pony.setLives(Commons.LIVES_COUNT); Commons.MUSHROOM_EFFECT = false; barriers.clear(); isPaused = false; isRunning = true; blank_cursor(MainPanel.this); clear_all(); lives = new JLabel(); past_time = new JLabel(); past_time.setForeground(Color.YELLOW); lives.setForeground(Color.YELLOW); past_time.setFont(new Font("serif", 0, 40)); lives.setFont(new Font("serif", 0, 40)); past_time.setSize(300, 100); lives.setSize(300, 100); past_time.setLocation(Commons.WIDTH / 2 - 300 / 2, Commons.HEIGHT - 100); lives.setLocation(Commons.WIDTH / 2 - 300 / 2, 0); past_time.setText("Время:"); lives.setText("Жизни:"); add(past_time); add(lives); add(money); time = 0; repaint(); }
public void mouseDragged(MouseEvent e) { gameCursorLabel.setLocation(e.getX() - XFUDGE, e.getY() - YFUDGE); hitBox.setLocation(gameCursorLabel.getLocation()); menuCursorLabel.setLocation(e.getX(), e.getY()); for (int i = 0; i < aLabel.size(); i++) sendCursorLocation(aLabel.get(i)); // Tells certain bugs where you are }
public void init_layout() { setLayout(null); money = new JLabel(); money.setLocation(10, 0); money.setSize(380, 100); money.setFont(new Font("serif", 0, 30)); money.setForeground(Color.WHITE); money.setText("Деньги: " + Commons.MONEY); lives = new JLabel(); lives.setForeground(Color.YELLOW); lives.setFont(new Font("serif", 0, 40)); lives.setSize(300, 100); lives.setLocation(Commons.WIDTH / 2 - 300 / 2, 0); lives.setText("Жизни:"); past_time = new JLabel(); past_time.setForeground(Color.YELLOW); past_time.setFont(new Font("serif", 0, 40)); past_time.setSize(300, 100); past_time.setLocation(Commons.WIDTH / 2 - 300 / 2, Commons.HEIGHT - 100); past_time.setText("Время:"); setFocusable(true); setTimer(); setKeyListener(); showMainMenu(); }
private void init() { this.setMinimumSize(new Dimension(360, 200)); this.setPreferredSize(new Dimension(360, 200)); this.setSize(new Dimension(360, 200)); setUndecorated(true); lblTitle.setSize(new java.awt.Dimension(360, 20)); lblTitle.setLocation(new java.awt.Point(20, 20)); lblTitle.setVisible(true); Font bigFont = new Font(lblTitle.getFont().getName(), Font.BOLD, TITLE_FONT_SIZE); Font smallFont = new Font(lblTitle.getFont().getName(), Font.PLAIN, OTHER_FONT_SIZE); lblTitle.setFont(bigFont); lblTitle.setText("Processing ..."); lblNote.setSize(new java.awt.Dimension(360, 20)); lblNote.setLocation(new java.awt.Point(20, 60)); lblNote.setVisible(true); lblNote.setFont(smallFont); jpbProgressBar.setValue(0); jpbProgressBar.setSize(new Dimension(230, 20)); jpbProgressBar.setLocation(new java.awt.Point(60, 100)); jpbProgressBar.setStringPainted(true); jpbProgressBar.setString(""); jpbProgressBar.setIndeterminate(true); jpbProgressBar.setVisible(true); btnCancel.setSize(new java.awt.Dimension(90, 30)); btnCancel.setLocation(new java.awt.Point(135, 140)); btnCancel.setVisible(true); pnlContent.setLayout(null); pnlContent.add(lblTitle); pnlContent.add(lblNote); pnlContent.add(jpbProgressBar); pnlContent.add(btnCancel); pnlContent.setPreferredSize(new Dimension(360, 160)); pnlContent.setBorder(BorderFactory.createLineBorder(Color.BLACK, 1)); getContentPane().add(pnlContent, BorderLayout.CENTER); setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); addWindowListener( new WindowAdapter() { public void windowClosing(WindowEvent we) { btnCancel.doClick(); } }); btnCancel.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { lblNote.setText("Cancelling..."); PromptListenerManager.fireTaskComplete(true); } }); }
public void guisetup() { frame = new JFrame("Screenshot Gatherer"); // frame.setFocusable(false); frame.setLayout(null); frame.setSize(1000, 600); // frame.setVisible(true); matchCount = new JLabel(); matchCount.setLocation(0, 0); matchCount.setSize(150, 30); picLabel = new JLabel(); picLabel.setLocation(0, 30); picLabel.setSize(600, 550); frame.add(picLabel); // picLabel.repaint(); frame.add(matchCount); updateMatchCount(); textArea = new JTextPane(); textArea.setLocation(0, 0); textArea.setSize(200, 600); JScrollPane scrollable = new JScrollPane(textArea); scrollable.setLocation(600, 0); scrollable.setSize(200, 600); scrollable.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); frame.add(scrollable); textAreaSeen = new JTextPane(); textAreaSeen.setLocation(0, 0); textAreaSeen.setSize(200, 600); JScrollPane scrollable2 = new JScrollPane(textAreaSeen); scrollable2.setLocation(800, 0); scrollable2.setSize(200, 600); scrollable2.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); // frame.add(textArea); frame.add(scrollable2); recordingCheckbox = new JCheckBox(); recordingCheckbox.setLocation(150, 0); recordingCheckbox.setSize(270, 30); recordingCheckbox.setText("Automatically Save Screenshots"); frame.add(recordingCheckbox); saveScreenshotButton = new JButton(); saveScreenshotButton.setLocation(420, 0); saveScreenshotButton.setSize(180, 30); saveScreenshotButton.setText("Save Screenshot"); frame.add(saveScreenshotButton); }
private void initComponents() { int change = 30; title.setBounds(449, 27, 148, 39); title.setFont(fnt1); labelID.setBounds(100, 180 - change, 131, 30); textID.setBounds(206, 184 - change, 144, 24); labelLocation.setBounds(86, 300 - change, 131, 30); textLocation.setBounds(206, 303 - change, 144, 24); labelID.setFont(fnt); labelLocation.setFont(fnt); userId.setLocation(389, 62); userId.setSize(180, 25); userRole.setLocation(514, 62); userRole.setSize(180, 25); OK.setBounds(86, 533 - change, 120, 40); cancel.setBounds(230, 533 - change, 120, 40); butOut.setBounds(52, 36, 120, 40); butAdd.setBounds(114, 632 - change, 120, 40); butDel.setBounds(336, 632 - change, 120, 40); butFind.setBounds(557, 632 - change, 120, 40); butChange.setBounds(779, 632 - change, 120, 40); this.add(title); this.add(labelID); this.add(textID); this.add(labelLocation); this.add(textLocation); this.add(OK); this.add(cancel); this.add(butOut); this.add(butAdd); this.add(butDel); this.add(butFind); this.add(butChange); this.add(userId); this.add(userRole); String[] columnNames = {"机构编号", "机构所处城市"}; int[] list = {40, 272, 14, 30, 20, 384, 126 - change, 561, 465}; // list里面参数分别为需要的列数,每一列的宽度,设置第一行字体大小,设置第一行行宽, // * 剩下行的行宽,表格setbounds(list[5],list[6], list[7], list[8]) // * table = new Table(); add(table.drawTable(columnNames, list)); InformationFind findInfo = new InformationFind(); ArrayList<InstitutionVO> ins = findInfo.findInstitution(); for (int i = 0; i < ins.size(); i++) { table.setValueAt(i, 1, ins.get(i).getLocation()); table.setValueAt(i, 0, ins.get(i).getID()); } }
public EmployeeCUDialog(JFrame owner, String title) { super(owner); this.setTitle(title); this.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE); this.setLocation(500, 250); this.setSize(200, 300); this.setLayout(null); this.setModal(true); lblName = new JLabel("Name:"); this.add(lblName); lblName.setLocation(20, 10); lblName.setSize(100, 25); txfName = new JTextField(); this.add(txfName); txfName.setLocation(20, 35); txfName.setSize(150, 25); lblWage = new JLabel("Wage:"); this.add(lblWage); lblWage.setLocation(20, 70); lblWage.setSize(100, 25); txfWage = new JTextField(); this.add(txfWage); txfWage.setLocation(20, 95); txfWage.setSize(150, 25); lblCompany = new JLabel("Company:"); this.add(lblCompany); lblCompany.setLocation(20, 130); lblCompany.setSize(100, 25); cbxCompanies = new JComboBox<Company>(); this.add(cbxCompanies); cbxCompanies.setLocation(20, 155); cbxCompanies.setSize(150, 25); cbxCompanies.setMaximumRowCount(4); btnOk = new JButton("Ok"); this.add(btnOk); btnOk.setLocation(15, 225); btnOk.setSize(70, 25); btnOk.addActionListener(controller); btnCancel = new JButton("Cancel"); this.add(btnCancel); btnCancel.setLocation(95, 225); btnCancel.setSize(80, 25); btnCancel.addActionListener(controller); // initialise this view controller.fillCbxCompanies(); }
public Abschluss(String wahl, Sudoku s, Sudoku2 s2) { super("Sudoku-Abschluss"); this.setSize(270, 135); this.setLocation(250, 300); this.setLayout(null); this.setAlwaysOnTop(true); this.setResizable(false); this.setUndecorated(true); if (s == null) this.setLocationRelativeTo(s2); else this.setLocationRelativeTo(s); su = s; su2 = s2; w = wahl; ImageIcon icon = new ImageIcon("files/minigames/Sudoku/beispiel2.jpg"); icon.setImage(icon.getImage().getScaledInstance(290, 135, Image.SCALE_DEFAULT)); lab = new JLabel(icon); lab.setSize(270, 135); lab.setLocation(0, 0); this.add(lab); text = new JLabel(); text.setSize(250, 20); text.setLocation(10, 10); text.setForeground(Color.white); text.setHorizontalAlignment(0); lab.add(text); text2 = new JLabel(); text2.setSize(270, 20); text2.setLocation(10, 30); text2.setForeground(Color.white); lab.add(text2); ok = new JButton("OK"); ok.setSize(90, 30); ok.setLocation(80, 50); ok.setBorderPainted(false); ok.setBackground(Color.lightGray); ok.setForeground(Color.lightGray); ok.setOpaque(false); ok.setFont(new Font("Arial Black", 4, 20)); ok.setContentAreaFilled(false); ok.setFocusPainted(false); ok.addActionListener(this); ok.addMouseListener(this); lab.add(ok); textWahl(wahl); this.setVisible(true); }
public void mouseMoved(MouseEvent e) { gameCursorLabel.setLocation(e.getX() - XFUDGE, e.getY() - YFUDGE); hitBox.setLocation(gameCursorLabel.getLocation()); menuCursorLabel.setLocation(e.getX(), e.getY()); for (int i = 0; i < aLabel.size(); i++) sendCursorLocation(aLabel.get(i)); // Tells certain bugs where you are if (onTitleScreen) { // When game is not running, the cursors are directly on pointer // Checks if mouse is over a box if ((e.getX() >= 55 && e.getX() <= 55 + 54 && e.getY() >= 695 && e.getY() <= 695 + 61) || (e.getX() >= 725 && e.getX() <= 725 + 54 && e.getY() >= 695 && e.getY() <= 695 + 61)) rainbowCursorAnimation(); else menuCursorLabelAnimating = false; } }
private void addThanks() { int padding = 5; int lineHeight = 20; int lineDistance = 4; int x; int y = padding; for (int i = 0; i < THANKS.length; i++) { final Thanks thanks = THANKS[i]; x = padding; ImageIcon icon = FileAssets.getImageIcon(thanks.getIconFilePath(), lineHeight, lineHeight); JLabel lblIcon = new JLabel(icon); lblIcon.setLocation(x, y); lblIcon.setSize(lineHeight, lineHeight); panThanksList.add(lblIcon); x += 30; JLabel lblReceiver = new JLabel(thanks.getReceiver()); lblReceiver.setLocation(x, y); lblReceiver.setSize(130, lineHeight); lblReceiver.setForeground(Color.WHITE); panThanksList.add(lblReceiver); x += 135; JLabel lblDescription = new JLabel(thanks.getDescription()); lblDescription.setLocation(x, y); lblDescription.setSize(240, lineHeight); lblDescription.setForeground(Color.WHITE); panThanksList.add(lblDescription); x += 245; if (thanks.hasURL()) { JLabel lblURL = new JLabel("<html><u>" + thanks.getURL() + "</u></html>"); lblURL.setLocation(x, y); lblURL.setSize(300, lineHeight); lblURL.setForeground(Color.WHITE); lblURL.setCursor(new Cursor(Cursor.HAND_CURSOR)); lblURL.addMouseListener( new MouseAdapter() { @Override public void mouseClicked(MouseEvent evt) { super.mouseClicked(evt); Util.browseURL(thanks.getURL()); } }); panThanksList.add(lblURL); } y += lineHeight + lineDistance; } panThanksList.setPreferredSize(new Dimension(573, y)); }
private void drawCircle(int tokenID, int tokenTile) { int circleXPos = tileCoordinates[tokenTile][0] - (circle.getWidth() - tokens.get(tokenID).getWidth()) / 2; int circleYPos = tileCoordinates[tokenTile][1] - (circle.getHeight() - tokens.get(tokenID).getHeight()) / 2; circle.setLocation(circleXPos, circleYPos); }
public UpdaterSelectWizardPanel(UpdaterData data) { super(); data_ = data; setPreferredSize(new Dimension(500, 400)); addButtons(NEXT_BACK_CANCEL); setEnableButton(BUTTON_BACK, false); useHeaderPanel(HEADER, SUBHEADER, "/imc/lecturnity/converter/images/lecturnity_logo.gif"); getContentPanel().setLayout(null); JLabel desc = new JLabel(SELECT); desc.setFont(NORMAL_FONT); desc.setLocation(30, 100); desc.setSize(460, 15); getContentPanel().add(desc); presentationFileField_ = new JTextField(""); presentationFileField_.setFont(NORMAL_FONT); presentationFileField_.setLocation(30, 120); presentationFileField_.setSize(440, 22); getContentPanel().add(presentationFileField_); JButton findButton = new JButton(FIND); // if (imc.lecturnity.converter.ConverterWizard.USE_CUSTOM_COLORS) if (USE_CUSTOM_COLORS) findButton.setBackground(Wizard.BG_COLOR); findButton.setSize(120, 30); findButton.setLocation(30, 148); findButton.setMnemonic(MNEM_FIND); findButton.addActionListener(new FindButtonListener()); getContentPanel().add(findButton); }
private JPanel getCrearAccionPanel() { if (crearAccionPanel == null) { accionLabel = new JLabel(); accionLabel.setFont(new Font("Dialog", Font.BOLD, 12)); accionLabel.setBounds(new Rectangle(45, 60, 97, 16)); accionLabel.setText("Nombre acción:"); categoriaLabel = new JLabel(); categoriaLabel.setLocation(new Point(75, 30)); categoriaLabel.setFont(new Font("Dialog", Font.BOLD, 12)); categoriaLabel.setText("Categoría:"); categoriaLabel.setSize(new Dimension(61, 16)); crearAccionPanel = new JPanel(); crearAccionPanel.setLayout(null); crearAccionPanel.setLocation(new Point(13, 13)); crearAccionPanel.setSize(new Dimension(441, 102)); crearAccionPanel.setBorder( BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Acción", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, new Font("Dialog", Font.BOLD, 12), new Color(51, 51, 51))); crearAccionPanel.add(categoriaLabel, null); crearAccionPanel.add(accionLabel, null); crearAccionPanel.add(getCategoriaTextField(), null); crearAccionPanel.add(getAccionTextField(), null); } return crearAccionPanel; }
private void showInfo() { clear_all(); JLabel lbl = new JLabel( "<html>Автор идеи - Илья Конжезёров<br>" + "Разработчик - Клим Парпеев<br>" + "Музыка:<ul>" + "<li>Яков Филин – Interlude</li>" + "<li>Duck Sause – NRG</li>" + "<li>Knife Party – EDM Trend Machine</li>" + "<li>Jack U – Take U There (feat. Kiesza)</li>" + "<li>Cash Cash – Kiss the Sky<br></li></ul>" + "Happy Baby Production<br>" + "The NIPEL Inc. (c) 2015</html>"); lbl.setFont(new Font("serif", 0, 25)); lbl.setForeground(Color.WHITE); lbl.setSize(700, 500); lbl.setLocation(Commons.WIDTH / 2 - 700 / 2, 10); add(lbl); JButton back = new JButton("Назад"); back.setSize(190, 75); back.setLocation(Commons.WIDTH / 2 - 190 / 2, Commons.HEIGHT - 150); back.setForeground(Color.GREEN); back.setBorderPainted(false); back.setFocusPainted(false); back.setContentAreaFilled(false); back.setFont(new Font("serif", 0, 40)); back.addActionListener(ev -> showMainMenu()); add(back); repaint(); }
public void initComponents() { Container c = this.getContentPane(); this.setTitle("Login Choice"); this.setSize(600, 500); this.setLayout(null); // button Vietnamese language btnVietnamese = new JButton("Tiếng Việt"); btnVietnamese.setSize(100, 25); btnVietnamese.setLocation(50, 100); c.add(btnVietnamese); // title JLabel lblTile = new JLabel("Choose login"); lblTile.setSize(200, 30); lblTile.setLocation(180, 100); lblTile.setFont(new Font("Arial", Font.BOLD, 30)); c.add(lblTile); // button English language btnEnglish = new JButton("English"); btnEnglish.setSize(100, 25); btnEnglish.setLocation(400, 100); c.add(btnEnglish); // radio button connect to database radConnect = new JRadioButton("Connect to Database"); radConnect.setSize(200, 20); radConnect.setLocation(100, 200); // radio button not connect to database radNotConnect = new JRadioButton("Not connect to database"); radNotConnect.setSize(200, 20); radNotConnect.setLocation(300, 200); // group radio buttons ButtonGroup group = new ButtonGroup(); group.add(radConnect); group.add(radNotConnect); c.add(radConnect); c.add(radNotConnect); // button connect btnConnect = new JButton("Connect"); btnConnect.setSize(100, 25); btnConnect.setLocation(50, 300); c.add(btnConnect); // button not connect btnNotConnect = new JButton("Not connect"); btnNotConnect.setSize(120, 25); btnNotConnect.setLocation(200, 300); c.add(btnNotConnect); // button login btnLogin = new JButton("Login"); btnLogin.setSize(100, 25); btnLogin.setLocation(370, 300); c.add(btnLogin); this.setVisible(true); }
public void moverIzquierda() { if (compruebaIzquierda()) { x -= 4; bomberman.setLocation(x, y); bomberman.repaint(); } }
public void moverAbajo() { if (compruebaAbajo()) { y += 4; bomberman.setLocation(x, y); bomberman.repaint(); } }
public void moverDerecha() { if (compruebaDerecha()) { x += 4; bomberman.setLocation(x, y); bomberman.repaint(); } }
/** Spousti se pri tazeni mysi. Pokud je figLabel neprazdne, tahne drzenou figurou. */ private void eCatcherMouseDragged( java.awt.event.MouseEvent evt) { // GEN-FIRST:event_eCatcherMouseDragged if (figLabel == null) { return; } figLabel.setLocation(evt.getX() + xAdjustment, evt.getY() + yAdjustment); } // GEN-LAST:event_eCatcherMouseDragged
public void moverArriba() { if (compruebaArriba()) { y -= 4; bomberman.setLocation(x, y); bomberman.repaint(); } }
public PanellMonstres(FinestraPpal fin) { imgfons = new JLabel(new ImageIcon("fons_1.png")); imgfons.setLocation(0, 0); imgfons.setSize(390, 540); imgfons.setVisible(true); finestra = fin; setLayout(new GridBagLayout()); propsLay = new GridBagConstraints(); propsLay.gridx = 0; propsLay.gridy = 0; propsLay.fill = GridBagConstraints.BOTH; propsLay.weightx = 1.0; propsLay.weighty = 1.0; this.add(imgfons, propsLay); // this.add(imgfons, propsLay); // Fixem tamany finestra setSize(390, 540); // this.setBackground(Color.YELLOW); fin.setContentPane(this); this.setLocation(0, 0); // Fixem tamany finestra fin.setSize(390, 540); fin.setVisible(true); }
/** * Spusti se pri zmacknuti tlacitka. Pokud je pod mysi obraz figury, zjisti, zda se muze pohnout * (pokud ano, upravi ho pro tahnuti, nastavi ho do figLabel) a zobrazi kontextovou napovedu. */ private void eCatcherMousePressed( java.awt.event.MouseEvent evt) { // GEN-FIRST:event_eCatcherMousePressed if (figLabel != null || finished) { return; } BoardSquare bsquare = (BoardSquare) eCatcher.getComponentAt(evt.getPoint()); JPanel fsquare = (JPanel) figurePan.getComponent(bsquare.getIndex()); sourceBSquare = bsquare; Point defLocation = fsquare.getLocation(); xAdjustment = (int) defLocation.getX() - evt.getX(); yAdjustment = (int) defLocation.getY() - evt.getY(); if (fsquare.getComponentCount() == 0) { return; } figLabel = (JLabel) fsquare.getComponent(0); setFocus(gui.getFocus(bsquare.getColumn(), bsquare.getRow())); if (!gui.canMove(bsquare.getColumn(), bsquare.getRow())) { figLabel = null; return; } fsquare.remove(figLabel); boardPane.add(figLabel, 0); figLabel.setLocation(evt.getX() + xAdjustment, evt.getY() + yAdjustment); figLabel.setSize(figLabel.getWidth(), figLabel.getHeight()); } // GEN-LAST:event_eCatcherMousePressed
public void run() { try { while (läuft) { Thread.sleep(1); if (verloren) { verloren(); } else { if (intro) { rot.setIcon(new ImageIcon("files/Minigames/Senso/red_n.png")); gruen.setIcon(new ImageIcon("files/Minigames/Senso/green_n.png")); blau.setIcon(new ImageIcon("files/Minigames/Senso/blue_n.png")); gelb.setIcon(new ImageIcon("files/Minigames/Senso/yellow_n.png")); lblVerloren.setText(""); start.setText("3"); Thread.sleep(1000); start.setText("2"); Thread.sleep(1000); start.setText("1"); Thread.sleep(1000); start.setLocation(start.getX() - 20, start.getY()); start.setText("Los!"); Thread.sleep(250); start.setText(""); start.setLocation(start.getX() + 20, start.getY()); rot.setIcon(new ImageIcon("files/Minigames/Senso/red_0.png")); gruen.setIcon(new ImageIcon("files/Minigames/Senso/green_0.png")); blau.setIcon(new ImageIcon("files/Minigames/Senso/blue_0.png")); gelb.setIcon(new ImageIcon("files/Minigames/Senso/yellow_0.png")); intro = false; neu = true; } if (wiedergeben && !verloren) { Thread.sleep(500); alteFarbe(); } else if (neu && !verloren) neueFarbe(); if (!wiedergeben && !neu) { String s = "Noch "; vKlicks = runde - klick; if (vKlicks >= 1) s = s + String.valueOf(vKlicks); else s = ""; klicks.setText(s); } else klicks.setText(""); } } } catch (Exception e) { } }
@Override public int move(long time, int width, int height, int d) { changeImage(); if (d == 0) setY(getY() + 26); setX(getX() + 32 * d); img.setLocation(getX(), getY()); return getX(); // direction; }
public void run() { int pos_x = 0; while (true) { pos_x += 2; lblPic.setLocation(pos_x, pos_y); Pause(time); if (pos_x >= wide) pos_x = 0; } }
/** * This method initializes lFichero * * @return javax.swing.JLabel */ private JLabel getLblName() { if (lblName == null) { lblName = new JLabel(); lblName.setSize(42, 20); lblName.setText(PluginServices.getText(this, "nombre")); lblName.setLocation(10, 9); } return lblName; }
/** A call of this method should validate the positions of the panels components. */ @Override public void relocate() { int w = 480, h = 245; int x = (this.getWidth() - w) / 2, y = (this.getHeight() - h) / 2; diffToolLabel.setLocation(x, y); diffToolField.setLocation(x + 160, y); diffToolLogLevelComboBox.setLocation(x + 380, y); }
/** * This method initializes this * * @return void */ private void initialize() { jLabel1 = new JLabel(); jLabel = new JLabel(); this.setLayout(null); this.setSize(278, 122); this.setPreferredSize(new java.awt.Dimension(150, 20)); jLabel.setText("Password"); jLabel.setLocation(23, 39); jLabel.setSize(58, 16); jLabel1.setText("Username"); jLabel1.setLocation(23, 15); jLabel1.setSize(59, 16); this.add(getPasswordField(), null); this.add(jLabel, null); this.add(jLabel1, null); this.add(getUsernameField(), null); this.add(getSavePasswordCheckBox(), null); this.add(getOkButton(), null); }
/** Creates new form CoverScreen */ public CoverScreen(CoverScreenData coverScreenData, Dimension dim) { this.coverScreenData = coverScreenData; initComponents(); csp = new CoverScreenMainPanel(); csp.addComponentListener( new ComponentAdapter() { public void componentResized(ComponentEvent e) { Insets insets = ((JPanel) e.getComponent()).getInsets(); Dimension size = closeIcon.getPreferredSize(); closeIcon.setBounds( (int) (((JPanel) e.getComponent()).getPreferredSize().getWidth() - size.width) + insets.left, insets.top, size.width, size.height); } }); csp.setLayout(null); closeIcon = new JLabel(); csp.setPreferredSize(dim.getSize()); closeIcon.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N closeIcon.setLocation(100, 100); closeIcon.setHorizontalAlignment(JLabel.RIGHT); closeIcon.setPreferredSize(new Dimension(10, 17)); closeIcon.setText("X"); closeIcon.setOpaque(true); if (coverScreenData != null) { float[] comps = coverScreenData.getBackgroundColor().getColorArray(); csp.setBackground(new Color(comps[0], comps[1], comps[2])); } csp.add(closeIcon); Insets insets = csp.getInsets(); Dimension size = closeIcon.getPreferredSize(); closeIcon.setBounds( (int) (csp.getPreferredSize().getWidth() - size.width) + insets.left, insets.top, size.width, size.height); jPanel1.add(csp, BorderLayout.CENTER); setPreferredSize(null); if (coverScreenData.getImageURL() != null && (!coverScreenData.getImageURL().equals(""))) { try { img = csp.scaleImage( AssetUtils.getAssetURL(coverScreenData.getImageURL()), (int) dim.getSize().getWidth(), (int) dim.getSize().getHeight()); } catch (MalformedURLException ex) { Logger.getLogger(CoverScreen.class.getName()).log(Level.SEVERE, null, ex); } } }
public void myLabel() { label.setSize(160, 20); label.setLocation(30, 200); label.setHorizontalAlignment(CENTER); this.add(label); this.repaint(); }