⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 selectlevelp.java

📁 java 版的俄罗斯方块在原来的基础上的网络版
💻 JAVA
字号:
package dialog;import java.awt.*;import java.awt.event.*;import TFrame;public class selectLevelP extends Panel{    TFrame m_tFrame;    Dialog m_dialog;    Scrollbar scrollbar1 = new Scrollbar();    Label label1 = new Label();    Button button1 = new Button();    GridBagLayout gridBagLayout1 = new GridBagLayout();    public selectLevelP(TFrame tFrame,Dialog d)    {        m_tFrame=tFrame;        m_dialog=d;        try        {            jbInit();            System.out.println(tFrame.m_tetrics.getPlayLevel());            scrollbar1.setValue(tFrame.m_tetrics.getPlayLevel());            label1.setText("你选择的的等级:"+scrollbar1.getValue());        }        catch(Exception e)        {            e.printStackTrace();        }    }    private void jbInit() throws Exception    {        this.setLayout(gridBagLayout1);        scrollbar1.setMaximum(15);        scrollbar1.setMinimum(1);        scrollbar1.setOrientation(0);        scrollbar1.setPageIncrement(1);        scrollbar1.setValue(5);        scrollbar1.setVisibleAmount(1);        scrollbar1.addAdjustmentListener(new java.awt.event.AdjustmentListener() {            public void adjustmentValueChanged(AdjustmentEvent e) {                scrollbar1_adjustmentValueChanged(e);            }        });        label1.setText("你选择的的等级:5");        button1.setLabel("确定");        button1.addActionListener(new java.awt.event.ActionListener()        {            public void actionPerformed(ActionEvent e)            {                button1_actionPerformed(e);            }        });        this.add(scrollbar1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0            ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(14, 39, 0, 45), 118, 3));        this.add(button1, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0            ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 84, 10, 85), 22, -3));        this.add(label1, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(9, 50, 0, 62), 35, 8));    }    void button1_actionPerformed(ActionEvent e)    {        m_dialog.dispose();    }    void scrollbar1_adjustmentValueChanged(AdjustmentEvent e)    {        label1.setText("你选择的的等级:"+scrollbar1.getValue());        int nLevel=scrollbar1.getValue();        m_tFrame.m_tetrics.setPlayLevel(nLevel);        if(m_tFrame.m_nNetStatus==TFrame.SERVER)m_tFrame.sendStr("Level:"+nLevel);    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -