2014년 12월 12일 금요일

[Java] JFrame Fullscreen 윈도우창 전체화면 만들기

I will make JFrame to Fullscreen.
JFrame을 전체화면으로 만들어볼 것이다.




You can just add short code for make foolscreen.
짧은 코드만 쓰면 전체화면으로 만들 수 있다.





add this code
이 코드를 쓰자.


Like this
이렇게





finish!


끝이다
이거 키면 전체화면으로 JFrame이 실행된다.





2014년 12월 11일 목요일

[Java][자바] JFrame 윈도우 창 띄우기.

Today I will write about JFrame.
오늘은 JFrame 에 대해 적어보겠다.


JFrame은 일종의 객체이다. 윈도우 창을 만들기 위해 필요하다.




code :






JFrame jfm = new JFrame("title");
jfm.setSize(500,500);
jfm.setVisible(true);






Finish.


끝!





실행시켜보면
launch.





finish.









2014년 12월 9일 화요일

[Minecraft] How to make a bukkit plugin : 1 setting and add commands

download minecraft bukkit in here http://plugins.bukkit.org/
I use 1.7.2 version.


launching eclipse and make new JavaProject


make pakage and class


add your bukkit-craftbukkit.jar to buildpath
write extends JavaPlugin next your class name.
last make 2 methods name onEnable and onDisable




like this






and then make boolean type method named onCommand


public boolean onCommand(CommandSender sender, Command command , String Label, String[] args)
 {
           if(Label.equalsIgnoreCase("a")) {
                    Player player = (Player) sender;
                    player.sendMessage("I am genius");
           }
  return true;


}

full code :




package hy.main;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
public class main extends JavaPlugin{
 public void onEnable() {

 }
 public void onDisable() {

 }
 public boolean onCommand(CommandSender sender, Command command , String Label, String[] args)
 {
  if(Label.equalsIgnoreCase("a")) {
   Player player = (Player) sender;
            player.sendMessage("I am genius");
  }
  return true;
 }
}


left side your project name - new - file


file name = plugin.yml


write






name : your project name
main : pakage name.class name
version : 1.0


commands :
  a:






save and Export to jar file


and put it to your bukkit-plugins forder and launching server
if you use command "/a" then server send Message to you "I am genius"









Download JDK,Eclipse

You have to download jdk
jdk is Java Delvelopment Kit

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

check Accept License Agreement


find your computer os and pick




setting eclipse


http://www.eclipse.org/downloads/






at listbox you can download Eclipse.



click this picture


finish!