(转)从C#里调用java程序
来源:互联网 发布:hexo 知乎图标 编辑:程序博客网 时间:2024/05/29 16:28
http://www.c-sharpcorner.com/1/CallingJavaFromCSMSRao.asp
What I want to say SUN (sun) and MS (moon) both are very Important to IT
WORLD (world) but both are now enemies now a days they are making languages
to dominate each other. This is sure without sun and moon there is no world
like that with out SUN and MS there is no IT WORLD. I pry to god to make both
are good friends they should work for IT PEOPLE.
This application has 4 files
shesharp.cs
javasharp.java
comp.bat //for compel
j.bat
In this application I used Inner class for developing panel.
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Diagnostics;
using System;
//for mixed background
public void format(object s,PaintEventArgs a)
{
Graphics g=CreateGraphics();
Rectangle rect=new Rectangle(0,0,300,300);
Color nyc=Color.FromArgb(200,50,5,200);
LinearGradientBrush b=new LinearGradientBrush(rect,Color.DarkOra
nge,nyc,LinearGradientMode.Vertical);
g.FillRectangle(b,rect);
}
//for calling java program
private void calljava(object ob,EventArgs arg)
{
Process.Start("j.bat");
}
//using Inner class for panel
public class pp:Panel
{
int x;
int y;
Timer t=new Timer();
String s="Hi.../nyou Know?/nWe are good Friends/nI can call Java ...";
String mail="mail me../nmallm_uma@rediffmail.com/nmahe_proj@rediffmail.
com";
private Label l=null;
private Label maill=null;
Color nyc;
//Constructor
public pp()
{
x=10;
y=200;
this.Location=new Point(0,10);
nyc=Color.FromArgb(200,10,5,225);
this.Size=new Size(300,230);
maill=new Label();
l=new Label();
l.Text=s;
l.Size=new Size(250,100);
l.ForeColor=nyc;
l.BackColor=Color.Transparent;
l.Font=new Font("verdana",15,FontStyle.Bold);
l.TextAlign=ContentAlignment.MiddleCenter;
maill.Text=mail;
maill.Size=new Size(160,40);
maill.Location=new Point(10,192);
maill.Font=new Font("verdana",7,FontStyle.Bold);
maill.ForeColor=Color.Yellow;
maill.BackColor=Color.Transparent;
this.Controls.Add(l);
this.Controls.Add(maill);
t.Interval=50;
t.Tick+=new EventHandler(draw);
t.Enabled=true;
}
protected override void OnPaint(PaintEventArgs a)
{
Graphics g=a.Graphics;
Rectangle rect=new Rectangle(0,0,300,230);
LinearGradientBrush b=new LinearGradientBrush(rect,Color.DarkOrange,ny
c,LinearGradientMode.Vertical);
g.FillRectangle(b,rect);
Font ff=new Font("Arial",14,FontStyle.Bold);
SolidBrush bb=new SolidBrush(nyc);
StringFormat df=new StringFormat();
}
//for animation
void draw(object ob,EventArgs a)
{
l.Location=new Point(x,y);
--y;
if(y==-100)y=230;
}
}
public static void Main()
{
Application.Run(new shesharp());
}
}
What I want to say SUN (sun) and MS (moon) both are very Important to IT
WORLD (world) but both are now enemies now a days they are making languages
to dominate each other. This is sure without sun and moon there is no world
like that with out SUN and MS there is no IT WORLD. I pry to god to make both
are good friends they should work for IT PEOPLE.
This application has 4 files
shesharp.cs
javasharp.java
comp.bat //for compel
j.bat
In this application I used Inner class for developing panel.
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Diagnostics;
using System;
//for mixed background
public void format(object s,PaintEventArgs a)
{
Graphics g=CreateGraphics();
Rectangle rect=new Rectangle(0,0,300,300);
Color nyc=Color.FromArgb(200,50,5,200);
LinearGradientBrush b=new LinearGradientBrush(rect,Color.DarkOra
nge,nyc,LinearGradientMode.Vertical);
g.FillRectangle(b,rect);
}
//for calling java program
private void calljava(object ob,EventArgs arg)
{
Process.Start("j.bat");
}
//using Inner class for panel
public class pp:Panel
{
int x;
int y;
Timer t=new Timer();
String s="Hi.../nyou Know?/nWe are good Friends/nI can call Java ...";
String mail="mail me../nmallm_uma@rediffmail.com/nmahe_proj@rediffmail.
com";
private Label l=null;
private Label maill=null;
Color nyc;
//Constructor
public pp()
{
x=10;
y=200;
this.Location=new Point(0,10);
nyc=Color.FromArgb(200,10,5,225);
this.Size=new Size(300,230);
maill=new Label();
l=new Label();
l.Text=s;
l.Size=new Size(250,100);
l.ForeColor=nyc;
l.BackColor=Color.Transparent;
l.Font=new Font("verdana",15,FontStyle.Bold);
l.TextAlign=ContentAlignment.MiddleCenter;
maill.Text=mail;
maill.Size=new Size(160,40);
maill.Location=new Point(10,192);
maill.Font=new Font("verdana",7,FontStyle.Bold);
maill.ForeColor=Color.Yellow;
maill.BackColor=Color.Transparent;
this.Controls.Add(l);
this.Controls.Add(maill);
t.Interval=50;
t.Tick+=new EventHandler(draw);
t.Enabled=true;
}
protected override void OnPaint(PaintEventArgs a)
{
Graphics g=a.Graphics;
Rectangle rect=new Rectangle(0,0,300,230);
LinearGradientBrush b=new LinearGradientBrush(rect,Color.DarkOrange,ny
c,LinearGradientMode.Vertical);
g.FillRectangle(b,rect);
Font ff=new Font("Arial",14,FontStyle.Bold);
SolidBrush bb=new SolidBrush(nyc);
StringFormat df=new StringFormat();
}
//for animation
void draw(object ob,EventArgs a)
{
l.Location=new Point(x,y);
--y;
if(y==-100)y=230;
}
}
public static void Main()
{
Application.Run(new shesharp());
}
}
- (转)从C#里调用java程序
- 从C#里调用java程序
- C#调用java程序
- 从C#程序中调用非受管DLLs
- 从C#程序中调用非受管DLLs
- 从C#程序中调用非受管DLLs
- 从C#程序中调用非受管DLLs
- 从C#程序中调用非受管DLLs
- 从C#程序中调用非受管DLLs
- 从C#程序中调用非受管DLLs
- 在ORACLE触发器里调用JAVA程序
- 在ORACLE触发器里调用JAVA程序
- java程序调用c# webservice
- 从java程序中调用其它程序
- 从java程序中调用其它程序
- 用C#程序调用java程序
- 从 C/C++ 程序调用 Java 代码
- 从 Java 程序调用 C/C++ 代码
- Timer和TimerTask详解
- ASP.NET 2.0中Gridview控件高级技巧
- jBPM-jpdl流程定义元素
- MVC用户认证web应用部分一
- Linux下各文件系统的比较
- (转)从C#里调用java程序
- CUPS的Web设置页面
- Infragistics做图 (原创人:yizhiduxiu)
- c#学习笔记4
- js源码--简单的div拖动
- 在JavaScript中实现命名空间
- 诡异的问题:在IE中上传附件很慢而FireFox中飞快
- J2ee应用程序结合水晶报表:例程研究
- ArcIMS的开发总结(一)