不過這方法找好久才找到……
可能是因為關鍵字吧……
我的關鍵字是
navigate java
最後是在這裡找到的。
代碼如下:
Desktop.getDesktop().browse(new URI(網址(String)));是說,action script 3就比較簡單,只要用下面代碼即可
navigateToURL(new URLRequest(網址(String)))而且還不用try/catch……
說是blog……雜記比較準確吧…
navigate java
Desktop.getDesktop().browse(new URI(網址(String)));navigateToURL(new URLRequest(網址(String)))
import java.awt.Color;
import java.awt.Container;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JColorChooser;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class ColorchooserTest extends JFrame implements ActionListener{
JButton button;
public ColorchooserTest(){
button = new Jbutton("Click Me");
button.addActionListener(this);
JPanel pane = new JPanel();
pane.setLayout(new GridLayout(1,1));
pane.add(button);
Container cpane = getContentPane();
cpane.setLayout(new GridLayout(1,1));
cpane.add(pane);
setTitle("TEST");
setSize(320, 240);
setVisible(true);
}
public void actionPerformed(ActionEvent arg0) {
if(arg0.getSource() == button){
Color c = null;
c =JColorchooser.showDialog(button,"a Color", button.getBackground());
System.out.print(c);
button.setBackground(c);
}
}
public static void main(String[] args) {
new ColorchooserTest();
}
}
<a style="cursor: hand" onclick="ID.style.display = ID.style.display=='none'?'':'none'" href="#NULL">click me</a>
<div id="ID" style=" DISPLAY: none; ">
test text</div><head>
<script type="text/javascript">
function hiddenxxx(x)
{
var txt = document.getElementById(x).style.display;
if (txt == "none")
{
document.getElementById(x).style.display = "block";
}
else if (txt == "block")
{
document.getElementById(x).style.display = "none";
}
}
</script>
</head>
<body>
<a href="#NULL" onclick ="hiddenxxx('test')">click me</a>
<span id="test" style ="display:none;" >test text</span>
</body>