/** Inicializace základních komponent okna */ private void init() { krokLabel = new JLabel("Synchronizace s web aplikací"); Font pismo = new Font("Arial", Font.BOLD, 14); krokLabel.setFont(pismo); NacitaciOkno.add(krokLabel); krokLabel.setBounds(90, 10, 250, 20); startButton = new JButton("Načíst"); startButton.setActionCommand("start"); startButton.setBounds(250, 110, 120, 25); startButton.addActionListener(new Start()); progressBar = new JProgressBar(0, 100); progressBar.setBounds(20, 60, 350, 25); progressBar.setValue(0); progressBar.setStringPainted(true); taskOutput = new JTextArea(5, 20); taskOutput.setMargin(new Insets(5, 5, 5, 5)); taskOutput.setEditable(false); NacitaciOkno.add(startButton); NacitaciOkno.add(progressBar); NacitaciOkno.setVisible(true); vybratButton = new JButton("Otevřít"); NacitaciOkno.add(vybratButton); vybratButton.setBounds(20, 110, 120, 25); vybratButton.addActionListener(new Zpet()); }
protected void addButtons() { JButton btnPrint = new JButton("Show"); btnPrint.setActionCommand("Show"); btnPrint.setBounds(219, 250, 117, 29); buttonList.add(btnPrint); frame.getContentPane().add(btnPrint); JButton btnStop = new JButton("Stop"); btnStop.setBounds(357, 250, 117, 29); buttonList.add(btnStop); frame.getContentPane().add(btnStop); JButton btnSave = new JButton("Save"); btnSave.setBounds(284, 493, 117, 29); buttonList.add(btnSave); frame.getContentPane().add(btnSave); JButton btnLoadMorphism = new JButton("Load Morphism"); btnLoadMorphism.setBounds(521, 193, 135, 29); buttonList.add(btnLoadMorphism); frame.getContentPane().add(btnLoadMorphism); JButton btnSaveMorphism = new JButton("Save Morphism"); btnSaveMorphism.setBounds(381, 193, 135, 29); buttonList.add(btnSaveMorphism); frame.getContentPane().add(btnSaveMorphism); super.addButtonList(buttonList); }
public MainInterface() { super(); setBackground(new Color(245, 255, 250)); setLayout(null); setSize(400, 400); setBounds(70, 80, 400, 290); // setBounds(100, 150, 400, 300); setVisible(true); setBorder(new LineBorder(Color.GREEN, 3, true)); registerstudent = new JButton(); registerstudent.setText("REGISTER STUDENTS"); registerstudent.setBounds(80, 30, 230, 25); registerstudent.addActionListener(this); add(registerstudent); viewStudentPlofile = new JButton(); viewStudentPlofile.setText("VIEW STUDENTS PROFILE"); viewStudentPlofile.setBounds(80, 120, 230, 25); viewStudentPlofile.addActionListener(this); add(viewStudentPlofile); adminstration = new JButton(); adminstration.setText("FEE ADMINISTRATION "); adminstration.setBounds(80, 200, 230, 25); adminstration.addActionListener(this); add(adminstration); }
public CFSecuritySwingISOCurrencyAskDeleteJPanel( ICFSecuritySwingSchema argSchema, ICFSecurityISOCurrencyObj argFocus) { super(); final String S_ProcName = "construct-schema-focus"; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 1, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. swingSchema = argSchema; swingFocus = argFocus; // Construct the various objects textAreaMessage = new JTextArea("Are you sure you want to delete this ISO Currency?"); actionOk = new ActionOk(); actionCancel = new ActionCancel(); buttonOk = new JButton(actionOk); buttonCancel = new JButton(actionCancel); attrJPanel = argSchema.getISOCurrencyFactory().newAttrJPanel(argFocus); scrollPane = new CFHSlaveJScrollPane(attrJPanel); // Lay out the widgets setSize(1024, 480); Dimension min = new Dimension(480, 300); setMinimumSize(min); add(textAreaMessage); textAreaMessage.setBounds(0, 0, 1024, 50); int xparts = (768 - (2 * 125)) / 3; add(buttonOk); buttonOk.setBounds(xparts, 55, 125, 40); add(buttonCancel); buttonCancel.setBounds(xparts + 125 + xparts, 55, 125, 40); add(scrollPane); scrollPane.setBounds(0, 100, 1024, 480 - 100); }
private void componentes() { JLabel lblLogin = new JLabel("Login"); lblLogin.setFont(new Font("Tahoma", Font.PLAIN, 13)); lblLogin.setBounds(10, 11, 46, 14); getContentPane().add(lblLogin); jLogin = new JTextField(); jLogin.setBounds(66, 9, 128, 20); getContentPane().add(jLogin); jLogin.setColumns(10); JLabel lblSenha = new JLabel("Senha"); lblSenha.setFont(new Font("Tahoma", Font.PLAIN, 13)); lblSenha.setBounds(10, 36, 46, 14); getContentPane().add(lblSenha); jSenha = new JPasswordField(); jSenha.setBounds(66, 40, 128, 20); getContentPane().add(jSenha); jSenha.setColumns(10); btnEntrar = new JButton("Entrar"); btnEntrar.setBounds(204, 8, 128, 23); getContentPane().add(btnEntrar); btnNovoCadastro = new JButton("Novo Cadastro"); btnNovoCadastro.setBounds(204, 39, 128, 23); getContentPane().add(btnNovoCadastro); btnEsqueciASenha = new JButton("Esqueci a Senha"); btnEsqueciASenha.setBounds(66, 71, 128, 23); getContentPane().add(btnEsqueciASenha); }
/** updates the buttons/text to language specific */ public void updateLocale() { if (I18N.currentLocale == Locale.deDE) { edit.setBounds(420, 20, 120, 30); donate.setBounds(330, 20, 80, 30); mapInstall.setBounds(620, 20, 190, 30); mapInstallLocation.setBounds(420, 20, 190, 30); serverbutton.setBounds(420, 20, 390, 30); tpInstallLocation.setBounds(420, 20, 190, 30); tpInstall.setBounds(620, 20, 190, 30); } else { edit.setBounds(480, 20, 60, 30); donate.setBounds(390, 20, 80, 30); mapInstall.setBounds(650, 20, 160, 30); mapInstallLocation.setBounds(480, 20, 160, 30); serverbutton.setBounds(480, 20, 330, 30); tpInstallLocation.setBounds(480, 20, 160, 30); tpInstall.setBounds(650, 20, 160, 30); } launch.setText(I18N.getLocaleString("LAUNCH_BUTTON")); edit.setText(I18N.getLocaleString("EDIT_BUTTON")); serverbutton.setText(I18N.getLocaleString("DOWNLOAD_SERVER_PACK")); mapInstall.setText(I18N.getLocaleString("INSTALL_MAP")); serverMap.setText(I18N.getLocaleString("DOWNLOAD_MAP_SERVER")); tpInstall.setText(I18N.getLocaleString("INSTALL_TEXTUREPACK")); donate.setText(I18N.getLocaleString("DONATE_BUTTON")); dropdown_[0] = I18N.getLocaleString("PROFILE_SELECT"); dropdown_[1] = I18N.getLocaleString("PROFILE_CREATE"); writeUsers((String) users.getSelectedItem()); optionsPane.updateLocale(); modPacksPane.updateLocale(); mapsPane.updateLocale(); tpPane.updateLocale(); }
public Welcome() { c.setLayout(null); c.add(welcome); welcome.setBounds(250, 100, 600, 50); welcome.setFont(font1); welcome.setForeground(Color.black); c.add(hotel); hotel.setBounds(350, 170, 700, 50); hotel.setFont(font2); hotel.setForeground(Color.black); c.add(check); check.setBounds(450, 350, 250, 50); check.addActionListener(this); c.add(order); order.setBounds(150, 350, 250, 50); order.addActionListener(this); c.add(bill); bill.setBounds(750, 350, 250, 50); bill.addActionListener(this); c.add(exit); exit.setBounds(40, 600, 130, 20); exit.addActionListener(this); c.add(back).setBounds(0, 0, 1800, 1000); }
private void setMovable(final JFrame frame) { String titlePath = "img/Title/"; JButton title = new JButton(new ImageIcon(titlePath + frameName + ".png")); title.addMouseListener( new MouseAdapter() { public void mousePressed(MouseEvent e) { CommonFrame.origin.x = e.getX(); CommonFrame.origin.y = e.getY(); } }); title.addMouseMotionListener( new MouseMotionAdapter() { public void mouseDragged(MouseEvent e) { Point p = frame.getLocation(); frame.setLocation(p.x + e.getX() - origin.x, p.y + e.getY() - origin.y); } }); if (frameName.equals("LoginFrame")) { title.setBounds(30, 30, 900, 82); } else { title.setBounds(30, 30, 800, 70); } title.setBorderPainted(false); title.setFocusable(false); add(title); }
public ViewOperateUI(MainUIService main) { setLayout(null); m = main; this.setBounds(0, 0, 850, 700); this.setBackground(Color.WHITE); Font font2 = new Font("楷体", Font.BOLD, 18); JLabel title = new JLabel("经 营 状 态 表"); title.setBounds(320, 30, 200, 40); title.setFont(font2); this.add(title); tabpane = new JTabbedPane(JTabbedPane.TOP); initPanelList(); tabpane.setBounds(50, 80, tablewidth, tableheight); this.add(tabpane); Listener listen = new Listener(); excel = new JButton("导出到Excel"); excel.setBounds(250, 620, 150, 40); excel.setVisible(true); excel.setFont(new Font("隶书", Font.PLAIN, 20)); excel.addMouseListener(listen); this.add(excel); exit = new JButton("返回"); exit.setBounds(430, 620, 150, 40); exit.setVisible(true); exit.setFont(new Font("隶书", Font.PLAIN, 20)); exit.addMouseListener(listen); this.add(exit); }
private void JButtonInit() { // Reserva de memoria para los JButton. OkButton = new JButton(); CancelButton = new JButton(); // Establecimiento del tama�o, textos y tipo de letra para OkButton. OkButton.setBounds(new Rectangle(195, 115, 100, 30)); OkButton.setText("Ok"); OkButton.setFont(new java.awt.Font("Button", 1, 12)); // Establecimiento de la funcionalidad de OkButton. OkButton.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { OkButtonActionPerformed(e); } }); // Establecimiento del tama�o, texto y tipo de letra para CancelButton. CancelButton.setBounds(new Rectangle(310, 115, 100, 30)); CancelButton.setText("Cancel"); CancelButton.setFont(new java.awt.Font("Button", 1, 12)); // Establecimiento de la funcionalidad de CancelButton. CancelButton.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { CancelButtonActionPerformed(e); } }); }
/** Create the frame. */ public CashierPage() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 505, 397); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); JLabel lblCashier = new JLabel("Cashier"); lblCashier.setFont(new Font("Tahoma", Font.PLAIN, 18)); lblCashier.setBounds(174, 11, 70, 37); contentPane.add(lblCashier); JButton btnCreateOrder = new JButton("Create Order"); btnCreateOrder.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { CreateOrder create = new CreateOrder(); create.setVisible(true); } }); btnCreateOrder.setBounds(38, 66, 121, 23); contentPane.add(btnCreateOrder); JButton btnChangeOrder = new JButton("Change Order"); btnChangeOrder.setBounds(267, 66, 121, 23); contentPane.add(btnChangeOrder); }
/** 初始化桌面控件 */ private void initView() { int btnWidth = (APP_WIDTH - 48) / 3; Container body = getContentPane(); body.setLayout(null); // select json mBtnJsonFile = new JButton(BTN_TITLE_JSON); mBtnJsonFile.setActionCommand(CMD_SELECE_JSON); mBtnJsonFile.addActionListener(this); mBtnJsonFile.setBounds(10, 10, 294, 40); body.add(mBtnJsonFile); // select desc mBtnDescDir = new JButton(BTN_TITLE_DESC); mBtnDescDir.setActionCommand(CMD_SELECT_DESC); mBtnDescDir.addActionListener(this); mBtnDescDir.setBounds(10, 60, 294, 40); body.add(mBtnDescDir); // run mBtnRun = new JButton("构建"); mBtnRun.setActionCommand(CMD_RUN); mBtnRun.addActionListener(this); mBtnRun.setBounds(10, 162, 294, 40); body.add(mBtnRun); mCheckBox = new JCheckBox("使用set get 方法"); mCheckBox.setBounds(10, 121, 294, 23); body.add(mCheckBox); mFileChooser = new JFileChooser(); }
// Initialization this component private void jbInit() { this.getContentPane().setLayout(null); setTitle("Files selection"); scriptFileChooser.setBounds(new Rectangle(5, 2, 485, 48)); outputFileChooser.setBounds(new Rectangle(5, 38, 485, 48)); comparisonFileChooser.setBounds(new Rectangle(5, 74, 485, 48)); okButton.setToolTipText("OK"); okButton.setIcon(okIcon); okButton.setBounds(new Rectangle(123, 134, 63, 44)); okButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { okButton_actionPerformed(e); } }); cancelButton.setBounds(new Rectangle(283, 134, 63, 44)); cancelButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { cancelButton_actionPerformed(e); } }); cancelButton.setToolTipText("CANCEL"); cancelButton.setIcon(cancelIcon); this.getContentPane().add(scriptFileChooser, null); this.getContentPane().add(outputFileChooser, null); this.getContentPane().add(comparisonFileChooser, null); this.getContentPane().add(okButton, null); this.getContentPane().add(cancelButton, null); setSize(500, 210); setLocation(20, 415); }
public Cliente(Socket s) { super("OPERACIONES CON BD"); socket = s; try { salida = new DataOutputStream(socket.getOutputStream()); inObjeto = new ObjectInputStream(socket.getInputStream()); } catch (IOException e) { e.printStackTrace(); System.exit(0); } setLayout(null); etiqueta.setBounds(10, 10, 200, 30); add(etiqueta); empconsultar.setBounds(210, 10, 50, 30); add(empconsultar); textarea1 = new JTextArea(); scrollpane1 = new JScrollPane(textarea1); scrollpane1.setBounds(10, 50, 400, 300); add(scrollpane1); boton.setBounds(420, 10, 100, 30); add(boton); desconectar.setBounds(420, 50, 100, 30); add(desconectar); textarea1.setEditable(false); boton.addActionListener(this); desconectar.addActionListener(this); setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); }
private void initButtonPanel() { // Ok button mOkButton = new JButton("Ok"); mOkButton.setBounds(110, 10, 100, 20); mOkButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { okActionPerformed(); } }); // Cancel button mCancelButton = new JButton("Cancel"); mCancelButton.setBounds(210, 10, 100, 20); mCancelButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { cancelActionPerformed(); } }); // Button panel mButtonPanel = new JPanel(null); mButtonPanel.add(mOkButton); mButtonPanel.add(mCancelButton); }
/*Przycisk Dodaj Ocene wywo³uje nowe okienko */ void DodajOcene(JDesktopPane a) { JDesktopPane desktopPane = a; final JButton btnDodajOcene = new JButton("Dodaj ocen\u0119"); btnDodajOcene.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent akcja) { if (akcja.getSource() == btnDodajOcene) { closelButtonActionPerformed(akcja); DodajOcene.main(null); } } }); btnDodajOcene.setBounds(10, 399, 132, 39); desktopPane.add(btnDodajOcene); JButton btnPrio = new JButton("Ustaw priorytet"); btnPrio.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { // lblChemia.setForeground(Color.RED); // UstawPriorytet ustawPriorytet = new UstawPriorytet(); closelButtonActionPerformed(e); UstawPriorytet.main(null); } }); btnPrio.setBounds(10, 449, 132, 39); desktopPane.add(btnPrio); }
public LayerDesignPanel(MainFrame father) { this.father = father; this.setLayout(null); jsp.setBounds(10, 10, 800, 600); this.add(jsp); jspL.setBounds(820, 10, 140, 200); this.add(jspL); jl.setCellRenderer(new MyCellRenderer()); jbSaveLayer.setBounds(820, 220, 140, 20); this.add(jbSaveLayer); jbSaveLayer.addActionListener(this); jbLoadLayer.setBounds(820, 250, 140, 20); this.add(jbLoadLayer); jbLoadLayer.addActionListener(this); jbCreate.setBounds(820, 280, 140, 20); this.add(jbCreate); jbCreate.addActionListener(this); jbLoadAll.setBounds(820, 310, 140, 20); this.add(jbLoadAll); jbLoadAll.addActionListener(this); jtfCengMing.setBounds(820, 340, 140, 20); this.add(jtfCengMing); }
/** Construtor da classe GameBoard */ public GameView(GameController controller, GameEngine engine) { super("Regras"); this.controller = controller; this.engine = engine; this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setBounds(550, 200, 350, 250); this.setVisible(true); this.setLayout(null); selecione = new JLabel("Selecione uma das regras para o jogo:"); selecione.setBounds(60, 30, 300, 30); add(selecione); conway = new JButton("Conway"); add(conway); conway.setBounds(30, 80, 120, 40); highlife = new JButton("Highlife"); add(highlife); highlife.setBounds(170, 80, 120, 40); livefreeordie = new JButton("LiveFreeOrDie"); add(livefreeordie); livefreeordie.setBounds(100, 140, 120, 40); ButtonHandler handler = new ButtonHandler(); conway.addActionListener(handler); highlife.addActionListener(handler); livefreeordie.addActionListener(handler); }
public MenuPainel() { try { i = ImageIO.read(new File("21.jpg")); } catch (IOException e) { System.out.println(e.getMessage()); System.exit(1); } this.setLayout(null); JButton newgame = new JButton("Iniciar Jogo"); newgame.setBounds(20, 240, 200, 30); newgame.setName("NovoJogo"); newgame.addMouseListener(tt); JButton rules = new JButton("Regras"); rules.setBounds(20, 280, 200, 30); rules.setName("Regras"); rules.addMouseListener(tt); JButton exit = new JButton("Sair"); exit.setBounds(20, 320, 200, 30); exit.setName("Sair"); exit.addMouseListener(tt); this.add(newgame); this.add(rules); this.add(exit); }
private void init(icwarehousemanui icwarehousemanui) { icwarehousemanJpanel = new icwarehousemanJpanel(); operationJpanel = new icwarehousemanb2OperationJpanel(icwarehousemanJpanel, icwarehousemanui, this); ImageIcon b1Icon = new ImageIcon("picture/新建入库单.png"); ImageIcon b2Icon = new ImageIcon("picture/单据反馈.png"); b1 = new JButton(b1Icon); b2 = new JButton(b2Icon); b1.setBounds(30, 200, 200, 50); b2.setBounds(30, 400, 200, 50); b1.setContentAreaFilled(false); b2.setContentAreaFilled(false); icwarehousemanJpanel.add(b1); icwarehousemanJpanel.add(b2); icwarehousemanJpanel.add(operationJpanel); icwarehousemanJpanel.setLayout(null); this.add(icwarehousemanJpanel); this.setSize(1024, 730); // 居中 Toolkit kitToolkit = Toolkit.getDefaultToolkit(); Dimension screenSize = kitToolkit.getScreenSize(); int screenWidth = screenSize.width; int screenHeight = screenSize.height; int windowWidth = this.getWidth(); int windowHeight = this.getHeight(); this.setLocation((screenWidth - windowWidth) / 2, (screenHeight - windowHeight) / 2); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // 不允许窗口改变大小 this.setResizable(false); this.setVisible(true); }
public BarUI(BarCntl theBarCntl) { this.theBarCntl = theBarCntl; this.newBar = new Bar(); this.setSize(400, 300); this.setLocationRelativeTo(null); this.setResizable(false); this.setLayout(new BorderLayout()); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); topPanel = new JPanel(); centerPanel = new JPanel(); back = new JButton("< Back"); back.setBounds(50, 50, 100, 50); back.addActionListener(this); topPanel.add(back); getBar = new JButton("Get Bar"); getBar.setBounds(50, 50, 100, 50); getBar.addActionListener(this); topPanel.add(getBar); displayBar = new JTextArea("Press 'Get Bar'"); displayBar.setMargin(new Insets(20, 20, 20, 50)); displayBar.setFont(displayBar.getFont().deriveFont(18.0f)); displayBar.setEditable(false); centerPanel.add(displayBar); this.add(topPanel, BorderLayout.NORTH); this.add(centerPanel, BorderLayout.CENTER); }
public int doLayoutRetHeight() { Dimension sz = getSize(); final int itemHeight = 25; final int itemSpacing = 5; final int labelWidth = 150; final int buttonHeight = 35; final int buttonWidth = 100; int y = itemSpacing; int fieldWidth = sz.width - (itemSpacing + labelWidth + itemSpacing + itemSpacing); int fieldX = itemSpacing + labelWidth + itemSpacing; int buttonSpacing = (sz.width - (buttonWidth + buttonWidth)) / 4; labelFileName.setBounds(itemSpacing, y, labelWidth, itemHeight); textFileName.setBounds(fieldX, y, fieldWidth, itemHeight); y = y + itemHeight + itemSpacing; labelLogContents.setBounds(itemSpacing, y, labelWidth, itemHeight); int logContentsHeight = sz.height - (y + buttonHeight + itemSpacing + itemSpacing); if (logContentsHeight < 100) { logContentsHeight = 100; } textLogContents.setBounds(fieldX, y, fieldWidth, logContentsHeight); y = y + logContentsHeight + itemSpacing + itemSpacing; buttonChooseFile.setBounds(buttonSpacing, y, buttonWidth, buttonHeight); buttonImportFile.setBounds( buttonSpacing + buttonWidth + buttonSpacing, y, buttonWidth, buttonHeight); buttonClose.setBounds( buttonSpacing + buttonWidth + buttonSpacing + buttonWidth + buttonSpacing, y, buttonWidth, buttonHeight); y = y + buttonHeight + itemSpacing + itemSpacing; return (y); }
/** * Bedingungen und Positionen der Bestandteile * * @param Title Legt den Titeltext fest */ public Faehigkeiten(String Title) { super(Title); text = new JLabel( " Manaentzug: 5XP Lebensentzug: 10XP Elementarmeister: 15 XP"); // Legt den ersten Text im Label fest text.setFont(new Font("Serif", Font.PLAIN, 14)); // Legt Schriftgroesse und Font fest getContentPane().add(text); nummer1 = new JButton("Manaentzug"); // definiert Position und Größe für die Buttons nummer1.setBounds(50, 170, 200, 80); nummer1.addActionListener(this); nummer2 = new JButton("Elementarmeister"); // definiert Position und Größe für die Buttons nummer2.setBounds(190, 400, 200, 80); nummer2.addActionListener(this); nummer3 = new JButton("Lebensentzug"); // definiert Position und Größe für die Buttons nummer3.setBounds(330, 170, 200, 80); nummer3.addActionListener(this); if (Board.manaleech == false) { add(nummer1); } if (Board.elementarmeister == false) { add(nummer2); // fuegt die Buttons und den Text im ersten Label zu } if (Board.lifeleech == false) { add(nummer3); } add(text); }
public MenyStart() { setTitle("Era Brazu"); setVisible(true); setSize(410, 410); setLayout(null); setDefaultCloseOperation(EXIT_ON_CLOSE); setResizable(false); setBounds(450, 170, 410, 410); wyjscie = new JButton("Wyjscie"); wyjscie.setBounds(151, 300, 100, 20); wyjscie.addActionListener(this); add(wyjscie); poradnik = new JButton("Poradnik"); poradnik.setBounds(151, 250, 100, 20); poradnik.addActionListener(this); add(poradnik); pvp = new JButton("PVP"); pvp.setBounds(151, 150, 100, 20); pvp.addActionListener(this); add(pvp); pc = new JButton("WyzwanieSolo"); pc.setBounds(142, 200, 118, 20); pc.addActionListener(this); add(pc); }
private void initView() { mStartBtn = new JButton("开始游戏"); mExitBtn = new JButton("退出"); mApplyBtn = new JButton("应用设置"); mSoundBtn = new JButton(mSoundOnStr); mBgmBtn = new JButton(mBgmOnStr); mStartBtn.setBounds(900, 620, 100, 40); mExitBtn.setBounds(770, 620, 100, 40); mApplyBtn.setBounds(640, 620, 100, 40); mBgmBtn.setBounds(490, 620, 120, 40); mSoundBtn.setBounds(360, 620, 100, 40); mStartBtn.addActionListener(this); mExitBtn.addActionListener(this); mApplyBtn.addActionListener(this); mSoundBtn.addActionListener(this); mBgmBtn.addActionListener(this); add(mExitBtn); add(mStartBtn); add(mApplyBtn); add(mSoundBtn); add(mBgmBtn); }
public Fenetre(JFrame f) { frame_precedente = f; this.setTitle("Shitenno"); this.setSize(1200, 750); this.setResizable(false); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setLocationRelativeTo(null); this.setContentPane(new Panneau()); this.setLayout(null); // personnalisation du panel recouvrant toute la frame panelplateau.setOpaque(false); panelplateau.setBounds(0, 0, 1200, 800); this.add(panelplateau); // ajout des boutons passer sont tour et menu quitter.addActionListener(this); this.add(quitter); quitter.setBounds(1080, 620, 80, 30); passer_tour.addActionListener(this); this.add(passer_tour); passer_tour.setBounds(1080, 670, 80, 30); // this.setContentPane(new Panneau()); // this.setContentPane(new Mainjoueur()); // affichage de la frame this.setVisible(true); }
public PlayGamePanel(JFrame frame, BoardConfiguration bc) { this.bc = bc; this.frame = frame; ImageIcon icon = new ImageIcon("ent.jpg"); this.image = icon.getImage(); this.one = new TransparentButton("1 Player"); this.two = new TransparentButton("2 Players"); this.three = new TransparentButton("3 Players"); this.four = new TransparentButton("4 Players"); this.setSize(frame.getSize()); this.setLocation(0, 0); this.setLayout(null); one.setBounds(450, 140, 200, 40); two.setBounds(450, 200, 200, 40); three.setBounds(450, 260, 200, 40); four.setBounds(450, 320, 200, 40); this.add(one); this.add(two); this.add(three); this.add(four); this.back = new TransparentButton("Back"); back.setBounds(450, 380, 200, 40); this.add(back); this.one.setFont(new Font("calibri", Font.ITALIC, 30)); this.two.setFont(new Font("calibri", Font.ITALIC, 30)); this.three.setFont(new Font("calibri", Font.ITALIC, 30)); this.four.setFont(new Font("calibri", Font.ITALIC, 30)); this.back.setFont(new Font("calibri", Font.ITALIC, 30)); this.one.addMouseListener(this); this.two.addMouseListener(this); this.three.addMouseListener(this); this.four.addMouseListener(this); this.back.addMouseListener(this); this.back.setForeground(Color.red); }
public JFrameMain() { super("¿â´æ¹ÜÀí"); getContentPane().setLayout(null); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); btn_transfer = new JButton("\u4ED3\u5E93\u8C03\u62E8"); btn_transfer.addMouseListener(new MainFrame_btn_mouseListener(this)); btn_transfer.setBackground(Color.YELLOW); btn_transfer.setBounds(59, 73, 93, 23); getContentPane().add(btn_transfer); btn_search = new JButton("\u62A5\u635F\u62A5\u6EA2"); btn_search.addMouseListener(new MainFrame_btn_mouseListener(this)); btn_search.setBackground(Color.MAGENTA); btn_search.setBounds(59, 135, 93, 23); getContentPane().add(btn_search); btn_loss = new JButton("\u8FC7\u671F\u67E5\u8BE2"); btn_loss.addMouseListener(new MainFrame_btn_mouseListener(this)); btn_loss.setBackground(Color.RED); btn_loss.setBounds(225, 73, 93, 23); getContentPane().add(btn_loss); btn_change = new JButton("\u5E93\u5B58\u53D8\u52A8"); btn_change.addMouseListener(new MainFrame_btn_mouseListener(this)); btn_change.setForeground(new Color(0, 0, 0)); btn_change.setBackground(new Color(0, 255, 255)); btn_change.setBounds(225, 135, 93, 23); getContentPane().add(btn_change); }
// Audio recording\mixing private void audioEditor() { audioStudio.setLayout(null); record = new JButton("Record"); record.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); record.setToolTipText("Record Audio"); record.setBounds((width / 2) - 160, 0, 80, 25); audioStudio.add(record); audioStudio.add(audioformat); audioformat.setBounds(0, 0, 80, 25); audioformat.add("Wav"); audioformat.add("AIFC"); audioformat.add("AIFF"); audioformat.add("AU"); audioformat.add("SND"); audioStudio.add(sampleRate); sampleRate.setBounds(80, 0, 80, 25); sampleRate.add("8000"); sampleRate.add("11025"); sampleRate.add("16000"); sampleRate.add("22050"); sampleRate.add("44100"); audioStudio.add(channels); channels.setBounds(160, 0, 80, 25); channels.add("Mono"); channels.add("Stereo"); playaudio = new JButton("Play"); playaudio.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); playaudio.setToolTipText("Play recording"); playaudio.setBounds((width / 2), 0, 80, 25); audioStudio.add(playaudio); stopBtn = new JButton("Stop"); stopBtn.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); stopBtn.setToolTipText("Stop Recording"); stopBtn.setBounds((width / 2) - 80, 0, 80, 25); audioStudio.add(stopBtn); record.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { audio.captureAudio(); System.out.println(audio.getAudioFormat().getSampleRate()); System.out.println(audio.getAudioFormat().getChannels()); audio.audnum++; } }); stopBtn.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { audio.targetDataLine.stop(); audio.targetDataLine.close(); } }); }
@SuppressWarnings("static-access") public void componentesListaUsuario() { dados = new Vector<String>(); dados.add("Código"); dados.add("Nome do Serviço"); dados.add("Valor"); dtmListaTipoServico = new DefaultTableModel(); dtmListaTipoServico.setColumnIdentifiers(dados); jttListaTipoServico = new JTable(); jttListaTipoServico.setFont(new Font("Tahoma", Font.PLAIN, 12)); jttListaTipoServico.setModel(dtmListaTipoServico); jttListaTipoServico.getColumnModel().getColumn(0).setResizable(false); jttListaTipoServico.getColumnModel().getColumn(0).setPreferredWidth(60); jttListaTipoServico.getColumnModel().getColumn(1).setResizable(false); jttListaTipoServico.getColumnModel().getColumn(1).setPreferredWidth(337); jttListaTipoServico.getColumnModel().getColumn(2).setResizable(false); jttListaTipoServico.getColumnModel().getColumn(2).setPreferredWidth(100); jspListaTipoServico = new JScrollPane(jttListaTipoServico); jttListaTipoServico.setAutoResizeMode(jttListaTipoServico.AUTO_RESIZE_OFF); jspListaTipoServico.setBounds(10, 10, 500, 300); jpnListaTipoServico.add(jspListaTipoServico); jbtSelecionarTipoServico = new JButton("Selecionar"); jbtSelecionarTipoServico.setFont(new Font("Tahoma", Font.PLAIN, 12)); jbtSelecionarTipoServico.setBounds(10, 338, 110, 23); jpnListaTipoServico.add(jbtSelecionarTipoServico); jbtCancelarPesquisa = new JButton("Cancelar"); jbtCancelarPesquisa.setFont(new Font("Tahoma", Font.PLAIN, 12)); jbtCancelarPesquisa.setBounds(130, 339, 110, 23); jpnListaTipoServico.add(jbtCancelarPesquisa); }