当前位置: 首页 > news >正文

游戏充值网站怎么做网络广告的形式

游戏充值网站怎么做,网络广告的形式,wordpress安装ssl证书,开原网站制作这是一个非常基本的例子.它使用一个图像文件并将其放置在一个滚动窗格内(在一个圆形的方式).从那里,它只是使用Swing Timer来随机生成点(在图像的边界内).每次生成一个新点时,我只需使用scrollToRectVisible,传递它想要渲染的点的位置和大小.这将确保新点(和点)在滚动窗格中可见…这是一个非常基本的例子.它使用一个图像文件并将其放置在一个滚动窗格内(在一个圆形的方式).从那里,它只是使用Swing Timer来随机生成点(在图像的边界内).每次生成一个新点时,我只需使用scrollToRectVisible,传递它想要渲染的点的位置和大小.这将确保新点(和点)在滚动窗格中可见.import java.awt.Color;import java.awt.EventQueue;import java.awt.FontMetrics;import java.awt.Graphics;import java.awt.GridBagConstraints;import java.awt.GridBagLayout;import java.awt.Point;import java.awt.Rectangle;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.awt.image.BufferedImage;import java.io.File;import java.io.IOException;import java.util.ArrayList;import java.util.List;import javax.imageio.ImageIO;import javax.swing.ImageIcon;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JLayeredPane;import javax.swing.JPanel;import javax.swing.JScrollPane;import javax.swing.Timer;import javax.swing.UIManager;import javax.swing.UnsupportedLookAndFeelException;import javax.swing.border.LineBorder;public class ScrollTest {public static void main(String[] args) {new ScrollTest();}private JScrollPane scrollPane;private DesktopPane desktopPane;public ScrollTest() {EventQueue.invokeLater(new Runnable() {Overridepublic void run() {try {UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {ex.printStackTrace();}try {desktopPane new DesktopPane();scrollPane new JScrollPane(desktopPane);JFrame frame new JFrame(Testing);frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);frame.add(scrollPane);frame.setSize(desktopPane.getPreferredSize().width / 2, desktopPane.getPreferredSize().height / 2);frame.setLocationRelativeTo(null);frame.setVisible(true);} catch (IOException exp) {exp.printStackTrace();}}});}public class DesktopPane extends JLayeredPane {private List points;public DesktopPane() throws IOException {points new ArrayList(25);final BufferedImage img ImageIO.read(new File(Desktop.jpg));final JLabel desktop new JLabel(new ImageIcon(img));final JPanel overlay new JPanel() {Overrideprotected void paintComponent(Graphics g) {super.paintComponent(g);int xOff desktop.getX();int yOff desktop.getY();int count 0;FontMetrics fm g.getFontMetrics();int height fm.getHeight();for (Point p : points) {g.setColor(Color.RED);String text Integer.toString(count);int width fm.stringWidth(text);int radius Math.max(width, height) 5;int x xOff p.x - radius / 2;int y yOff p.y - radius / 2;g.fillOval(x, y, radius, radius);g.setColor(Color.WHITE);x (radius - width) / 2;y ((radius - height) / 2) fm.getAscent();g.drawString(text, x, y);}}};overlay.setOpaque(false);setLayout(new GridBagLayout());GridBagConstraints gbc new GridBagConstraints();gbc.gridx 0;gbc.gridy 0;gbc.weightx 1;gbc.weighty 1;gbc.fill GridBagConstraints.BOTH;add(desktop, gbc);add(overlay, gbc);setLayer(desktop, 0);setLayer(overlay, 5);overlay.setBorder(new LineBorder(Color.RED));Timer timer new Timer(1000, new ActionListener() {Overridepublic void actionPerformed(ActionEvent e) {int x (int) Math.round(Math.random() * img.getWidth());int y (int) Math.round(Math.random() * img.getHeight());points.add(new Point(x, y));repaint();FontMetrics fm getFontMetrics(overlay.getFont());int height fm.getHeight();String text Integer.toString(points.size() - 1);int width fm.stringWidth(text);int radius Math.max(width, height) 5;scrollRectToVisible(new Rectangle(x - radius / 2, y - radius / 2, radius, radius));}});timer.start();}}}现在,如果要将点显示为尽可能靠近中心,则需要额外的工作……现在,如果你真的想玩得开心,可以将延迟设置为50-100毫秒;)
http://www.pierceye.com/news/656722/

相关文章:

  • 优秀网站设计欣赏国内网站后期
  • 计算机应用技术php网站开发php网站进后台
  • asp网站安全小x导航正品
  • 陕西省建设监理协会网站成绩查询如何用网站做课件
  • 帝国网站怎么仿站个人做旅游网站的意义
  • 网站建设白沟做公众号策划的网站
  • 站长工具怎么用知名做网站哪家好
  • 做视频网站怎么备案企业内网
  • 建设网站南沙区建湖做网站找哪家好
  • 做网站应该会什么问题视频网站做app
  • 南阳做网站费用企业品牌维护
  • 分形科技做网站怎么样网站常用的js效果
  • 做企业展示网站网站建设与制作段考试题
  • 设计网站哪个好用网站建设策划方案t
  • 化妆培训学校网站建设徐州市工程建设交易平台
  • 杭州正规制作网站公司吗网站如何三合一
  • php网站开发说明手机网站建设的公司排名
  • 网站开发asp.net和sql数据库网页制作教程(第三版)书籍
  • wordpress搬站手机网站模板 html5
  • 免费设计网站网站开发及建设费用
  • 推广qq群的网站androidstudio开发app教程
  • 一个公司备案多个网站要注意合肥网站策划
  • 做网站推广也要营业执照吗网站关键词排名优化技巧
  • 网站建设需要考啥证广告设计与制作专业课程
  • 泸州市往建局建设银行网站名称广州网站建设 推广公司哪家好
  • 运维网站制作dw设计个人网页
  • 南城网站建设公司信息吉林省建设招标网站
  • 怎么把自己的网站上传到百度wordpress 文章拆分
  • 南湖网站建设公司百度app推广方法
  • 做海报用的图片网站数据库端口 wordpress