This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new Image.network( | |
'https://raw.githubusercontent.com/flutter/website/master/_includes/code/layout/lakes/images/lake.jpg', | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp(new MyApp()); | |
class MyApp extends StatelessWidget { | |
// This widget is the root of your application. | |
@override | |
Widget build(BuildContext context) { | |
return new MaterialApp( | |
title: 'Flutter Demo', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JLabel label = new JLabel(""); | |
Image img = new ImageIcon(this.getClass().getResource("/filename.jpg")).getImage(); | |
label.setIcon(new ImageIcon(img)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.valueOf(var).length() //gibt die Länge digits eines ints an |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Possible solution for HP Bar (Percentage caculation and rectangles) | |
https://gamedev.stackexchange.com/questions/110311/how-to-set-up-health-bar-rect-that-depends-on-health | |
// | |
// | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UIManager.put("ProgressBar.selectionBackground", Color.red); | |
UIManager.put("ProgressBar.selectionForeground", Color.red); | |
UIManager.put("ProgressBar.foreground", Color.red); | |
UIManager.put("ProgressBar.background", Color.red); | |
JProgressBar bar = new JProgressBar(); | |
bar.setMaximum(50); | |
bar.setMinimum(0); | |
bar.setBounds(30, 118, 235, 41); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
container.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); | |
//See Cursors Cheatsheet for the design |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package animation; | |
import java.awt.Graphics; | |
import java.awt.Graphics2D; | |
import java.awt.RenderingHints; | |
import javax.swing.JFrame; | |
import javax.swing.JPanel; | |
@SuppressWarnings("serial") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static final int WIDTH = 1280; | |
public static final int HEIGHT = 720; | |
private void initialize() { | |
frame = new JFrame(); | |
frame.setTitle("title"); | |
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); | |
frame.getContentPane().setLayout(null); | |
frame.setPreferredSize(new Dimension(WIDTH, HEIGHT)); |
OlderNewer