本文整理了Java中javax.swing.JLabel.setTransferHandler()
方法的一些代码示例,展示了JLabel.setTransferHandler()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JLabel.setTransferHandler()
方法的具体详情如下:
包路径:javax.swing.JLabel
类名称:JLabel
方法名:setTransferHandler
暂无
代码示例来源:origin: stackoverflow.com
add(label, gbc);
label.setTransferHandler(new ListTransferHandler());
代码示例来源:origin: com.twelvemonkeys.imageio/twelvemonkeys-imageio-pict
public void run() {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch (Exception ignore) {
}
JFrame frame = new JFrame("PICTClipping test");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JLabel dropZone = new JLabel("Drop images here", JLabel.CENTER) {
@Override
public Dimension getPreferredSize() {
return new Dimension(320, 200);
}
};
dropZone.setTransferHandler(new ImageDropHandler(dropZone));
frame.add(dropZone);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
});
代码示例来源:origin: stackoverflow.com
MouseListener listener = new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
JComponent c = (JComponent) e.getSource();
TransferHandler handler = c.getTransferHandler();
handler.exportAsDrag(c, e, TransferHandler.COPY);
}
};
// a transferHandler configured to export the text property
TransferHandler handler = new TransferHandler("text");
JComponent labels = new JPanel();
for (int i = 0; i < 4; i++) {
JLabel label1 = new JLabel("item: " + i);
label1.addMouseListener(listener);
label1.setTransferHandler(handler);
labels.add(label1);
}
代码示例来源:origin: IanDarwin/javasrc
private void setMyTransferHandlers(String s) {
TransferHandler th = new TransferHandler(s);
tf.setTransferHandler(th);
l.setTransferHandler(th);
}
}
代码示例来源:origin: ru.sbtqa/monte-media
@Override
public void setTransferHandler(TransferHandler newHandler) {
super.setTransferHandler(newHandler);
timelineEditor.setTransferHandler(newHandler);
timeLabel.setTransferHandler(newHandler);
}
代码示例来源:origin: stackoverflow.com
ImageIcon SD = new ImageIcon("resources/terrains/StoneDungeon.jpg");
JLabel dns=new JLabel( SD);
frame.getContentPane().add(dns);
dns.setBounds(800,150,50,50);
dns.setFont(new Font("Courior", Font.BOLD, 25));
dns.setForeground(Color.red);
dns.setTransferHandler(new TransferHandler("icon"));
MouseListener ml = new MouseAdapter(){
public void mousePressed(MouseEvent e){
JComponent jc = (JComponent)e.getSource();
TransferHandler th = jc.getTransferHandler();
th.exportAsDrag(jc, e, TransferHandler.COPY);
}
};
dns.addMouseListener(ml);
代码示例来源:origin: stackoverflow.com
label.setBackground(color);
label.addMouseListener(listener);
label.setTransferHandler(handler);
return label;
代码示例来源:origin: net.sf.squirrel-sql.plugins/graph
public GraphToFilesDlg(Window parent, BufferedImage[] images)
throws HeadlessException
{
super(parent);
// i18n[graphToClipboard.title=Copy graph image pages to clipboard]
setTitle(s_stringMgr.getString("graphToFile.title"));
buildGui();
lblPages = new JLabel[images.length];
for (int i = 0; i < images.length; i++)
{
lblPages[i] = new JLabel(new ImageIcon(images[i]));
lblPages[i].setTransferHandler(new ImageSelection());
tabPages.addTab("" + (i+1), new JScrollPane(lblPages[i]));
}
setSize(500, 450);
setVisible(true);
GUIUtils.centerWithinParent(this);
}
代码示例来源:origin: com.github.stephenc.monte/monte-screen-recorder
infoLabel.setTransferHandler(new DropFileTransferHandler(JFileChooser.DIRECTORIES_ONLY, null, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
代码示例来源:origin: ru.sbtqa/monte-media
infoLabel.setTransferHandler(new DropFileTransferHandler(JFileChooser.DIRECTORIES_ONLY, null, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
代码示例来源:origin: stackoverflow.com
labelTarget.setTransferHandler(labelHandler);
代码示例来源:origin: ru.sbtqa/monte-media
infoLabel.setTransferHandler(new DropFileTransferHandler(JFileChooser.DIRECTORIES_ONLY, null, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
代码示例来源:origin: com.github.stephenc.monte/monte-screen-recorder
infoLabel.setTransferHandler(new DropFileTransferHandler(JFileChooser.DIRECTORIES_ONLY, null, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
代码示例来源:origin: otros-systems/otroslogviewer
logFileContent.setTransferHandler(transferHandler);
loadLog.setTransferHandler(transferHandler);
logFileContentLabel.setTransferHandler(transferHandler);
内容来源于网络,如有侵权,请联系作者删除!