📄 frameproductstoryinformationshow.java~1~
字号:
package Manager;import javax.swing.*;import java.awt.*;import com.borland.jbcl.layout.*;import java.awt.event.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2003</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class FrameProductStoryInformationShow extends JFrame { int[] size={0,0,0,0,0,0,0,0,0}; JLabel jLabel1 = new JLabel(); XYLayout xYLayout1 = new XYLayout(); XYLayout xYLayout2 = new XYLayout(); XYLayout xYLayout3 = new XYLayout(); JPanel jPanelShow = new JPanel(); XYLayout xYLayout4 = new XYLayout(); public FrameProductStoryInformationShow() { try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } public FrameProductStoryInformationShow( int[] msize ) { size=msize; try { jbInit(); } catch(Exception e) { e.printStackTrace(); }} public static void main(String[] args) { FrameProductStoryInformationShow frameProductStoryInformationShow = new FrameProductStoryInformationShow(); } private void jbInit() throws Exception { jLabel1.setFont(new java.awt.Font("SansSerif", 1, 26)); jLabel1.setForeground(Color.red); jLabel1.setText(""); this.setTitle(""); this.getContentPane().setLayout(xYLayout1); this.setSize(687,496 ); xYLayout1.setWidth(682); xYLayout1.setHeight(491); jPanelShow.setBorder(BorderFactory.createLineBorder(Color.black)); jPanelShow.setLayout(xYLayout4); this.getContentPane().add(jLabel1, new XYConstraints(231, 26, 227, -1)); this.getContentPane().add(jPanelShow, new XYConstraints(23, 125, 633, 343)); CreateGraphics(); } void CreateGraphics(){ Graphics g ; g=jPanelShow.getGraphics(); int intMax=0; int MAXlength =1000; for (int i=0;i<=8;i++) { if(intMax<size[i]) {intMax=size[i]; } } g.setColor(Color.red ) ; g.drawString("36 size:",10,10); // g.fillRect(10,20,size[0] / intMax * MAXlength,10); g.setColor(Color.black ) ; g.drawString("37 size:",10,40); // g.fillRect(10,50,size[1] / intMax * MAXlength,10); g.setColor(Color.blue ) ; g.drawString("38 size:",10,70); // g.fillRect(10,80,size[2] / intMax * MAXlength,10); g.setColor(Color.yellow ) ; g.drawString("39 size:",10,100); // g.fillRect(10,110,size[3] / intMax * MAXlength,10); g.setColor(Color.white ) ; g.drawString("40 size:",10,130); // g.fillRect(10,140,size[4] / intMax * MAXlength,10); g.setColor(Color.green ) ; g.drawString("41 size:",10,160); // g.fillRect(10,170,size[5] / intMax * MAXlength,10); g.setColor(Color.cyan ) ; g.drawString("42 size:",10,190); // g.fillRect(10,200,size[6] / intMax * MAXlength,10); g.setColor(Color.lightGray ) ; g.drawString("43 size:",10,220); // g.fillRect(10,230,size[7] / intMax * MAXlength,10); g.setColor(Color.yellow ) ; g.drawString("44 size:",10,250); // g.fillRect(10,260,size[8] / intMax * MAXlength,10); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -