最近2018中文字幕在日韩欧美国产成人片_国产日韩精品一区二区在线_在线观看成年美女黄网色视频_国产精品一区三区五区_国产精彩刺激乱对白_看黄色黄大色黄片免费_人人超碰自拍cao_国产高清av在线_亚洲精品电影av_日韩美女尤物视频网站

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
滾動字幕java源代碼 滾動字幕的代碼

Java程序,實現(xiàn)字幕滾動,代碼如下,幫我查查錯誤在哪?程序可以運行漢字就是不動

加入

成都創(chuàng)新互聯(lián)專注于企業(yè)營銷型網(wǎng)站、網(wǎng)站重做改版、吳中網(wǎng)站定制設(shè)計、自適應(yīng)品牌網(wǎng)站建設(shè)、H5技術(shù)、商城網(wǎng)站制作、集團(tuán)公司官網(wǎng)建設(shè)、外貿(mào)營銷網(wǎng)站建設(shè)、高端網(wǎng)站制作、響應(yīng)式網(wǎng)頁設(shè)計等建站業(yè)務(wù),價格優(yōu)惠性價比高,為吳中等各大城市提供網(wǎng)站開發(fā)制作服務(wù)。

public void init()

{

new Thread(this).start();

}

這個是Applet生命周期中的初始化調(diào)用,這里啟用線程即可。

刪除public static void main(String[] args) {

new Thread(new RollWords()).start();

},這個沒用,Applet不用main執(zhí)行,而是用appletViewer或者瀏覽器執(zhí)行。

用Java編寫一個字符串循環(huán)滾動的程序

java里面有一個叫做Timer的東西

代碼找到了:

import java.awt.*;

import javax.swing.*;

import java.awt.event.*;

////////////////////////////////////////////////////////////

public class AnimationDemo extends JFrame{

AnimationDemo(){

add(new MPanel("我是要移動的文字"));

}

////////////////////////////////////////////////////////////

public static void main(String[] args){

JFrame frame=new AnimationDemo();

frame.setTitle("AnimationDemo");

frame.setSize(280, 100);

frame.setLocationRelativeTo(null);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

frame.setVisible(true);

}

/////////////////////////////////////////////////////////////

static class MPanel extends JPanel{

private String message="welcome to java!";

private int xZuoBiao=0;

private int yZuoBiao=30;

//...........................................................

public MPanel(String message){

this.message=message;

Timer timer=new Timer(100,new TimerListener());

timer.start();

}

//............................................................

protected void paintComponent(Graphics g){

super.paintComponent(g);

if(xZuoBiaogetWidth()){

xZuoBiao=-20;

}

xZuoBiao+=10;

g.drawString(message, xZuoBiao, yZuoBiao);

}

//.............................................................

class TimerListener implements ActionListener{

public void actionPerformed(ActionEvent e){

repaint();

}

}

}

}

滾動字幕內(nèi)容的字體大小 顏色怎么調(diào)???

1,字體顏色可變幻的滾動字幕源代碼:

div

style="filter:

glow(color=#000000

,strength=1);

color:

#000000;

height:

10px"font

size=3

marquee

style="width:

213px;

height:

120px"

scrollamount=1

scrolldelay=1

direction=up

width=213

height=120p

align=left公

:

brbr本

blog

brbr純

創(chuàng)

brbr未

經(jīng)

人許可

brbr不

自轉(zhuǎn)載brbr/p/font/marquee/font/div

2,橫向滾動字幕的源代碼:

marquee

border="0"

align="middle"

scrolldelay="120"小米的blog歡迎您的光臨!謝謝!/marquee

3,沒有背景的滾動字幕源代碼:

marquee

scrollamount=1

scrolldelay=77

direction=up

width=270

height=77onmouseout="this.start()"

onmouseover="this.stop()"不敢奢望擁有每一位博友的心br也不敢乞求別人嘉獎什么!br只希望感覺付出是有價值的!br所以才能有今天的進(jìn)步!br一切就看你心里要不要舍棄些!/marquee

提示:

1

,公告內(nèi)容可以根據(jù)自己的想法改,在代碼中改,字的中間可以加空格,

每一個br是一個單元,(把上面說的話改成你自己的話);

2

,scrollamount=1

scrolldelay=1可以設(shè)置數(shù)值,也就是滾動速度,數(shù)值越大滾動越快;

3

,direction=是滾動的方向,up=上,down=下,left=左,right=右,都可以自定義,愿意怎么滾動就怎么滾動;

4,width=

寬度,height=

高度可以更改,strength=16是光暈效果的大小,size=2是字體的大?。?/p>

5,color=#e6e8fa

是字體的顏色,好看的字體顏色有:

#ff1493;#228b22;

#4169e1;

#9400d3;#ff0000;#daa520

誰有JAVA的連續(xù)上下滾動字幕的源代碼

JS制作連續(xù)滾動字幕,鼠標(biāo)放上去自動停止

DIV

id=demo

style="OVERFLOW:

hidden;

WIDTH:

145px;

HEIGHT:

100px"

DIV

id=demo1

aaaabr

bbbbbr

ccccbr

ddddbr

eeeebr

ffffbr

ggggbr

/DIV

DIV

id=demo2/DIV

/DIV

SCRIPT

var

speed=50

var

_demo=document.getElementById("demo");

var

_demo1=document.getElementById("demo1");

var

_demo2=document.getElementById("demo2");

demo2.innerHTML=demo1.innerHTML

function

Marquee(){

if(_demo2.offsetTop-_demo.scrollTop=0){

_demo.scrollTop-=_demo1.offsetHeight

}else{

_demo.scrollTop++

}

}

var

MyMar=setInterval(Marquee,speed)

_demo.onmouseover=function()

{clearInterval(MyMar)}

_demo.onmouseout=function()

{MyMar=setInterval(Marquee,speed)}

/SCRIPT(study.iader.com)

Java程序 實現(xiàn)圖形面板上的字幕滾動效果

import java.awt.Container;

import java.awt.FlowLayout;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import javax.swing.JFrame;

import javax.swing.JOptionPane;

import javax.swing.JPasswordField;

import javax.swing.JTextField;

import javax.swing.JButton;

public class mi

{

private static String username;

private static String password ;

private static JTextField []t={

new JTextField("賬號:",8),new JTextField(10),

new JTextField("密碼:",8),new JPasswordField(10)};

public static void main (String args[]){

JFrame app=new JFrame("賬號密碼演示程序");

app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

app.setSize(280,120);

Container c=app.getContentPane();

c.setLayout(new FlowLayout());

t[0].setEditable(false);

t[2].setEditable(false);

for(int i=0;i4;i++)

c.add(t[i]);t[1].setText("");

JButton[]b={new JButton("確定"),new JButton("重置")};

c.add(b[0]);c.add(b[1]);

app.setLocationRelativeTo(null);

app.setVisible(true);

b[1].addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {

t[1].setText("");

t[3].setText("");

}

});

// 登錄按鈕加事件監(jiān)聽器

b[0].addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {

username = t[1].getText();

password = t[3].getText();

//判斷用戶名密碼是否正確

if (username.equals("數(shù)字") password.equals("123")) {

JOptionPane.showMessageDialog(null, "登陸成功!", "消息",

JOptionPane.INFORMATION_MESSAGE);

} else {

JOptionPane.showMessageDialog(null, "用戶名或密碼錯誤!", "錯誤",

JOptionPane.ERROR_MESSAGE);

}

}

}); }

}

使用Javascript制作連續(xù)滾動字幕

我們一般都用Marquee標(biāo)簽控制元素的滾動 但是單向的Marquee滾動是不連續(xù)的 每滾完一幕 就會出現(xiàn)一次空白 而下面介紹中的滾動則是連續(xù)的 毫不間斷

下面為你介紹這是如何實現(xiàn)的

為了滾動能夠 連續(xù) 我們需要將字幕的內(nèi)容復(fù)制多遍 直到內(nèi)容的高度不小于滾 動區(qū)高度的兩倍 然后我們將溢出的滾動條隱藏掉 用代碼控制滾動條向下移動(這時內(nèi)容將向上移動) 當(dāng)滾動條滾動到最下方時 理論上不能再往下滾動了 于是我們立刻調(diào)整滾動條 將它向上滾動到一個和當(dāng)前畫面一樣的位置 結(jié)果我們看到的就是連續(xù)的滾動了 呵呵 說的就是這么簡單 那做起來如何呢?我們看看是如何逐步實現(xiàn)的

<div id= marquees <! 這些是字幕的內(nèi)容 你可以任意定義 <a # 鏈接一</a<br <a # 鏈接二</a<br <a # 鏈接三</a<br <a # 鏈接四</a<br <! 字幕內(nèi)容結(jié)束 </div <! 以下是java script代碼 <script language= java script <! marqueesHeight= ; //內(nèi)容區(qū)高度stopscroll=false; //這個變量控制是否停止?jié)L動with(marquees){noWrap=true; //這句表內(nèi)容區(qū)不自動換行style width= ; //于是我們可以將它的寬度設(shè)為 因為它會被撐大style height=marqueesHeight;style overflowY= hidden ; //滾動條不可見onmouseover=new Function( stopscroll=true ); //鼠標(biāo)經(jīng)過 停止?jié)L動onmouseout=new Function( stopscroll=false ); //鼠標(biāo)離開 開始滾動}//這時候 內(nèi)容區(qū)的高度是無法讀取了 下面輸出一個不可見的層 templayer 稍后將內(nèi)容復(fù)制到里面 document write( <div id= templayer </div );function init(){ //初始化滾動內(nèi)容//多次復(fù)制原內(nèi)容到 templayer 直到 templayer 的高度大于內(nèi)容區(qū)高度 while(templayer offsetHeight<marqueesHeight){templayer innerHTML+=marquees innerHTML;} //把 templayer 的內(nèi)容的 兩倍 復(fù)制回原內(nèi)容區(qū) marquees innerHTML=templayer innerHTML+templayer innerHTML;//設(shè)置連續(xù)超時 調(diào)用 scrollUp() 函數(shù)驅(qū)動滾動條 setInterval( scrollUp() );}document body onload=init;preTop= ; //這個變量用于判斷滾動條是否已經(jīng)到了盡頭function scrollUp(){ //滾動條的驅(qū)動函數(shù)if(stopscroll==true) return; //如果變量 stopscroll 為真 則停止?jié)L動 preTop=marquees scrollTop; //記錄滾動前的滾動條位置marquees scrollTop+= ; //滾動條向下移動一個像素//如果滾動條不動了 則向上滾動到和當(dāng)前畫面一樣的位置//當(dāng)然不僅如此 同樣還要向下滾動一個像素(+ ) if(preTop==marquees scrollTop){marquees scrollTop=templayer offsetHeight marqueesHeight+ ;}} </script lishixinzhi/Article/program/Java/JSP/201311/19771


分享文章:滾動字幕java源代碼 滾動字幕的代碼
網(wǎng)頁地址:http://fisionsoft.com.cn/article/hhpssj.html